Changes between Version 34 and Version 35 of processus_thread
- Timestamp:
- Oct 17, 2017, 4:13:26 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
processus_thread
v34 v35 3 3 [[PageOutline]] 4 4 5 The process is the internal représentation of an user application. A process can be running as a single thread (called main thread), or can be multi-threaded. ALMOS-MK supports the POSIX thread API.5 The process is the internal représentation of an user application. A process can be running as a single thread (called main thread), or can be multi-threaded. ALMOS-MKH supports the POSIX thread API. 6 6 For a multi-threaded application, the number of threads can be very large, and the threads of a given process can be distributed on all cores available in the shared memory architecture, for maximal parallelism. Therefore A single process can spread on all clusters. To avoid contention, the process descriptor of a P process, and the associated structures, such as the list of registered vsegs ('''VSL'''), the generic page table ('''GPT'''), or the file descriptors table ('''FDT''') are (partially) replicated in all clusters containing at least one thread of P. 7 7 … … 10 10 The PID (Process Identifier) is coded on 32 bits. It is unique in the system, and has a fixed format: The 16 MSB (CXY) contain the owner cluster identifier. The 16 LSB bits (LPID) contain the local process index in owner cluster. The '''owner cluster''' is therefore defined by the 16 MSB bits of PID. 11 11 12 As it exists several copies of the process descriptors, ALMOS-MK defines a reference process descriptor, located in the '''reference cluster'''. The other copies are used as local caches, and ALMOS-MKmust guaranty the coherence between the reference and the copies.12 As it exists several copies of the process descriptors, ALMOS-MKH defines a reference process descriptor, located in the '''reference cluster'''. The other copies are used as local caches, and ALMOS-MKH must guaranty the coherence between the reference and the copies. 13 13 14 As ALMOS-MK supports process migration, the '''reference cluster''' can be different from the '''owner cluster'''. The '''owner cluster''' cannot change (because the PID is fixed), but the '''reference cluster''' can change in case of process migration.14 As ALMOS-MKH supports process migration, the '''reference cluster''' can be different from the '''owner cluster'''. The '''owner cluster''' cannot change (because the PID is fixed), but the '''reference cluster''' can change in case of process migration. 15 15 16 In 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 :16 In each cluster K, the local cluster manager ( cluster_t type in ALMOS-MKH ) contains a process manager ( pmgr_t type in ALMOS-MKH ) that maintains three structures for all process owned by K : 17 17 * The '''PREF_TBL[lpid]''' is an array indexed by the local process index. Each entry contains an extended pointer on the reference process descriptor. 18 18 * 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. 19 19 * 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. 20 20 21 There is a partial list of informations stored in a process descriptor ( process_t in ALMOS-MK):21 There is a partial list of informations stored in a process descriptor ( process_t in ALMOS-MKH ): 22 22 - '''PID''' : proces identifier. 23 23 - '''PPID''' : parent process identifier, … … 32 32 - '''CHILDREN_ROOT''' : root of global list of children process. 33 33 34 All 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-MKuses extended pointers.34 All elements of a ''local'' list are in the same cluster, and ALMOS-MKH uses local pointers. Elements of a ''global'' list can be distributed on all clusters, and ALMOS-MKH uses extended pointers. 35 35 36 36 == __2) Thread__ == 37 37 38 ALMOS-MK defines four types of threads :38 ALMOS-MKH defines four types of threads : 39 39 * one '''USER''' thread is created by a pthread_create() system call. 40 40 * one '''KERNEL''' thread is created by the kernel to execute a kernel service in a cluster. … … 72 72 The process creation in a remote cluster implement the POSIX fork() / exec() mechanism. 73 73 When a parent process P executes the fork() system call, a new child process C is created. 74 The new C process inherit from the parent process P the open files (FDT), and the memory image (VSL and GPT). These structures must be replicated in the new process descriptor. After a fork(), the C process can execute an exec() system call, that allocate a new memory image to the C process, but the new process can also continue to execute with the inherited memory image. For load balancing, ALMOS-MK uses the DQDT to create the child process C on a different cluster from the parent cluster P, but the user application can also use the fork_place() system call to specify the target cluster.74 The new C process inherit from the parent process P the open files (FDT), and the memory image (VSL and GPT). These structures must be replicated in the new process descriptor. After a fork(), the C process can execute an exec() system call, that allocate a new memory image to the C process, but the new process can also continue to execute with the inherited memory image. For load balancing, ALMOS-MKH uses the DQDT to create the child process C on a different cluster from the parent cluster P, but the user application can also use the fork_place() system call to specify the target cluster. 75 75 76 76 === 3.1) fork() ===