Changes between Version 36 and Version 37 of processus_thread


Ignore:
Timestamp:
Nov 7, 2017, 2:01:58 PM (7 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v36 v37  
    9292A thread of parent process P, running in a cluster X,  executes the fork() system call to create a child process C on a remote cluster Y, that will  become both the owner and the reference cluster for the C process. If the reference cluster Z for process P is different from X, the work must be done in  cluster Z, because only the reference cluster Z contains a complete description of the parent process VSL and GPT.
    9393
     94A new process descriptor, and a new thread descriptor must be created and initialized in target cluster Y for the child process.
     95
     96Regarding the process descriptor, a new PID must be allocated in cluster Y.  The child process C inherit the vsegs registered in the parent process VSL, but the ALMOS-MKH replication policy depends on the vseg type:
     97 * for the '''DATA, MMAP, REMOTE''' vsegs (containing shared, non replicated data), all vsegs registered in the parent reference VSL( (Z,P) are registered in the child  reference VSL(Y,C), and all valid GPT entries in the reference parent GPT(Z,P) are copied in the child reference GPT(Y,C). For all pages, the WRITABLE flag is reset and the COW flag is set, in both (parent and child) GPTs. This require to update all replicated parent GPT copies in all cluster.
     98 * for the '''STACK''' vseg(that are private), only one vseg is registered in the child reference VSL(Y,C). This vseg contains the user stack of the user thread requesting the fork, running in cluster X. All valid GPT entries in the parent GPT(X,P) are copied in the child GPT(Y,C). For all pages, the WRITABLE flag is reset and the COW flag is set, in both (parent and child) GPTs. This require to update all replicated parent GPT copies in all cluster.
     99 * for the '''CODE''' vsegs (that must be replicated in all clusters containing a thread), all vsegs registered in the reference parent VSL(Z,P) are registered in the child  reference VSL(Y,C), but the reference child GPT(Y,C) is not updated by the fork: It will be dynamically updated on demand in case of page fault. 
     100 * for the '''FILE''' vsegs (containing shared memory mapped files), all vsegs registered in the reference parent VSL(Z,P) are registered in the child  reference VSL(Y,C), and all valid entries registered in the reference parent GPT(Z,P) are copied in the reference child GPT(Y,C). The COW flag is not set for these shared data.
     101
     102Regarding the thread descriptor, a new TRDID must be allocated in cluster Y, and the calling parent thread context (current values stored in the CPU and FPU registers) must be saved in the child thread CPU and FPU contexts, to be restored when the child thread will be selected for execution.
     103Two CPU registers must be specifically initialized:
     104 * the '''thread pointer''' register contains the current thread descriptor address. This '''thread pointer''' register cannot have the same value for parent and child.   
     105 * the '''stack pointer''' register define the current kernel stack. ALMOS-MLH uses a specific kernel stack when an user thread enters the kernel, and this kernel stack is implemented in the thread descriptor. Parent and child cannot uses the same kernel stack. The parent kernel stack content must be copied to the child kernel stack,
     106and the '''stack pointer''' register cannot have the same value for parent and child.
     107
    94108=== 3.2) exec() ===
    95109