Changes between Version 20 and Version 21 of processus_thread


Ignore:
Timestamp:
Jul 15, 2016, 7:32:22 PM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v20 v21  
    1717
    1818In each cluster K, the local cluster manager (cluster_t type in ALMOS-MK) contains a process manager (pmgr_t type in ALMOS-MK) that maintains three structures for all process owned by K :
    19  * The PREF_TBL[lpid]] is an array indexed by the local process index. Each entry contains an extended pointer on the reference process descriptor.
    20  * The COPIES_ROOT[lpid] array is also indexed by the local process index. Each entry contains the root of the global list of copies for each process owned by cluster K.   
    21  * The LOCAL_ROOT is the root of the local list of all process descriptors in cluster K. A process descriptor copy of P is present in K, as soon as P has a thread in cluster K.
     19 * The '''PREF_TBL[lpid]''' is an array indexed by the local process index. Each entry contains an extended pointer on the reference process descriptor.
     20 * The '''COPIES_ROOT[lpid]''' array is also indexed by the local process index. Each entry contains the root of the global list of copies for each process owned by cluster K.   
     21 * The '''LOCAL_ROOT''' is the local list of all process descriptors in cluster K. A process descriptor copy of P is present in K, as soon as P has a thread in cluster K.
    2222
    23 The process descriptor (process_t in ALMOS-MK) contains the following informations:
    24 - PID :  proces identifier.
    25 - PPID : parent process identifier,
    26 - XMIN, XMAX, YMIN, YMAX : rectangle covering all active clusters.
    27 - PREF : extended pointer on the reference process descriptor.
    28 - VMM : virtual memory manager containing the PG_TBL and the VSEG_LIST.
    29 - FD_TBL : open file descriptors table.
    30 - TH_TBL : local table of threads owned by this process in this cluster.
    31 - LOCAL_LIST : member of local list of all process descriptors in same cluster.
    32 - COPIES_LIST : member of global list (globale) of all copies of same process.
    33 - CHILDREN_LIST : member of global list of all children of same parent process.
    34 - CHILDREN_ROOT : root of global list of children process.
     23There is a partial list of informations stored in a process descriptor (process_t in ALMOS-MK):
     24- '''PID''' :  proces identifier.
     25- '''PPID''' : parent process identifier,
     26- '''XMIN, YMIN, XMAX, YMAX''' : rectangle covering all active clusters.
     27- '''PREF''' : extended pointer on the reference process descriptor.
     28- '''VMM''' : virtual memory manager containing the PG_TBL and the VSEG_LIST.
     29- '''FD_TBL''' : open file descriptors table.
     30- '''TH_TBL''' : local table of threads owned by this process in this cluster.
     31- '''LOCAL_LIST''' : member of local list of all process descriptors in same cluster.
     32- '''COPIES_LIST''' : member of global list of all descriptors of same process.
     33- '''CHILDREN_LIST''' : member of global list of all children of same parent process.
     34- '''CHILDREN_ROOT''' : root of global list of children process.
    3535
    36 Elements of a local list are in the same clusters, and ALMOS-MK uses local pointers. Elements of a global list can be distributed on all clusters, and  ALMOS-MK uses extended pointers. 
     36All elements of a ''local'' list are in the same cluster, and ALMOS-MK uses local pointers. Elements of a ''global'' list can be distributed on all clusters, and  ALMOS-MK uses extended pointers. 
    3737
    3838== __2) Thread__ ==
     
    4040ALMOS-MK defines four types of threads :
    4141 * one '''USER''' thread is created by a pthread_create() system call.
    42  * one '''KERNEL''' thread is dynamically created by the kernel to execute a kernel service in a cluster.
     42 * one '''KERNEL''' thread is created by the kernel to execute a kernel service in a cluster.
    4343 * one '''RPC''' thread is activated by the kernel to execute one or several pending RPC requests.
    4444 * the  '''IDLE''' thread is executed when there is no other thread to execute on a core.
     
    4646From the point of view of scheduling, a thread can be in six states, as described in section [wiki:thead_scheduling D].
    4747
    48 This implementation of ALMOS-MK does not support thread migration: a thread is pinned on a given core in a given cluster. The only exception is the main thread of a process, that is automatically created by the kernel when a new process is created: This main thread follow its owner process in case of process migration.
     48This implementation of ALMOS-MK does not support thread migration: a thread is pinned on a given core in a given cluster. The only exception is the main thread of a process, that is automatically created by the kernel when a new process is created, and follows its owner process in case of process migration.
    4949
    50 An user thread is identified by a fixed format TRDID identifier, coded on 32 bits : The 16 MSB bits (CXY) define the cluster where the thread has been pinned. The 16 LSB bits (LTID) define the thread local index in the local TH_TBL[K,P] of
    51 a process descriptor P in a cluster K. This LTID index is allocated by the local process descriptor when the thread is created.
     50An user thread is identified by a fixed format TRDID identifier, coded on 32 bits : The 16 MSB bits (CXY) define the cluster where the thread has been pinned. The 16 LSB bits (LTID) define the thread local index in the local TH_TBL[K,P] of a process descriptor P in a cluster K. This LTID index is allocated by the local process descriptor when the thread is created.
    5251
    5352Therefore, the TH_TBL(K,P) thread table for a given process in a given clusters contains only the threads of P placed in cluster K. The set of all threads of a given process is defined by the union of all TH_TBL(K,P) for all active clusters K.
    5453To scan the set off all threads of a process P, ALMOS-MK traverse the COPIES_LIST of all process_descriptors associated to P process.
    5554
    56 The thread descriptor (thread_t in ALMOS-MK) contains the following  informations:
    57  * TRDID : thread identifier
    58  * PTRDID : parent thread identifier
    59  * TYPE : KERNEL / USER / IDLE / RPC
    60  * FLAGS : attributs du thread
    61  * PROCESS : pointer on the local process descriptor
    62  * STATE : CREATE / READY / USER / KERNEL / WAIT / DEAD
    63  * LOCKS_COUNT : current number of locks taken by this thread
    64  * PWS : zone de sauvegarde des registres du coeur.
    65  * XLIST : member of the global list of threads waiting on the same resource.
    66  * SCHED : pointer on the scheduler in charge of this thread.
    67  * CORE : pointer on the owner processor core.
    68  * IO : allocated devices (in case of privately allocated devices).
    69  * SIGNALS : bit vector permettant d’enregistrer les signaux reçus par le thread
     55There is a partial list of informations stored in a thread descriptor (thread_t in ALMOS-MK):
     56 * '''TRDID''' : thread identifier
     57 * '''TYPE''' : KERNEL / USER / IDLE / RPC
     58 * '''FLAGS''' : thread attributes
     59 * '''STATE''' : CREATE / READY / USER / KERNEL / WAIT / ZOMBI / DEAD
     60 * '''PROCESS''' : pointer on the local process descriptor
     61 * '''LOCKS_COUNT''' : current number of locks taken by this thread
     62 * '''PWS''' : zone de sauvegarde des registres du coeur.
     63 * '''SCHED''' : pointer on the scheduler in charge of this thread.
     64 * '''CORE''' : pointer on the owner processor core.
     65 * '''IO''' : allocated devices (in case of privately allocated devices).
     66 * '''SIGNALS''' : bit vector permettant d’enregistrer les signaux reçus par le thread.
     67 * '''XLIST''' : member of the global list of threads waiting on the same resource.
     68 * '''CHILDREN_ROOT''' : root of the global list of children threads.
     69 * '''CHILDREN_LIST''' : member of the global list of all children of same parent.
    7070- etc.
    7171
     
    7777=== 3.1) fork() ===
    7878
    79 The parent process P is running on a core in cluster K, and execute the fork() system call to create a new process F on a remote cluster Z that will  become the owner of the F process. It is selected by the kernel using the DQDT. Cluster K will contain the reference process descriptor. The fork() sys call execute the following steps:
     79The parent process P is running on a core in cluster K, and executes the fork() system call to create a new process F on a remote cluster Z that will  become the owner of the F process. It is selected by the kernel using the DQDT. Cluster K will contain the reference process descriptor. The fork() system call execute the following steps:
    8080
    8181 1. the cluster K allocates memory in K to store the reference process descriptor of F, and get a pointer on this process descriptor using the process_alloc() function.