Changes between Version 46 and Version 47 of processus_thread


Ignore:
Timestamp:
Nov 10, 2017, 12:03:00 PM (5 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v46 v47  
    7676=== 3.1) fork() ===
    7777
    78 NEW SPECIFICATION
    79 
    8078A 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. A new process descriptor, and a new thread descriptor must be created and initialized in target cluster Y for the child process.
    8179The calling thread  can run in any cluster. If the target cluster Y is different from the calling thread cluster X, the calling thread must use a RPC to ask the target cluster Y to do the work, because only the target cluster Y can allocate memory for the new process and thread descriptor.
     
    9290 * the '''stack pointer''' register define the current kernel stack. ALMOS-MKH uses a specific kernel stack when an user thread enters the kernel, and this kernel stack is implemented in the thread descriptor. As parent and child cannot use the same kernel stack, the parent kernel stack content must be copied to the child kernel stack, and the '''stack pointer''' register cannot have the same value for parent and child.
    9391
    94 OLD  SPECIFICATION (DEPRECATED)
    9592
    96 A thread of parent process P, running in a cluster K,  executes the fork() system call to create a new process C on a remote cluster Z, that will  become the owner for the C process. ALMOS-MK creates the first C process descriptor in the same cluster as the parent cluster P, and postpone the costly remote copy of VSL and GPT from P to C, because this copy is useless in case of exec(). When the fork() system call returns, the C process owner cluster is Z, but the reference process descriptor is in cluster K. The child process and the associated main thread will be migrated to cluster Z later, when the child process makes an "exec" or any other system call.
    97 
    98  1. the cluster K allocates memory in K for the reference process descriptor of C, and get a pointer on this process descriptor.
    99  1. the cluster K ask to kernel Z to allocate a PID for the C process, and to register the process descriptor extended pointer in its PREF_TBL(Z). It uses the RPC_PROCESS_PID_ALLOC that takes the process descriptor pointer as argument and returns the PID.
    100  1. after RPC completion, the kernel K initializes the C process descriptor from informations found in the P parent process descriptor.
    101  1. the kernel K creates locally the main thread of process C, and register this thread in the TH_TBL(K,C),
    102  1. the kernel K register this new thread in the scheduler of the core executing the fork() system call, an return.
    103 
    104 At the end of the fork(), the owner cluster for the new  C process is cluster Z, and the reference cluster is cluster K. This C process contains one single thread running on K.
     93At the end of the fork(), cluster Y is both the owner cluster and the reference cluster for the new  C process, that contains one single thread running in the Y cluster.
     94All pages of DATA, REMOTE, and MMAP vsegs are marked ''Copy On Write'' in the child C process GPT (clusters Y), and in all copies of the parent P process GPT (all clusters containing a copy of P). 
    10595
    10696=== 3.2) exec() ===