Changes between Version 32 and Version 33 of processus_thread
- Timestamp:
- Oct 11, 2016, 2:27:33 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
processus_thread
v32 v33 42 42 * the '''IDLE''' thread is executed when there is no other thread to execute on a core. 43 43 44 From the point of view of scheduling, a thread can be in six states, as described in section [wiki:thead_scheduling D].44 From the point of view of scheduling, a thread can be in three states : RUNNING, RUNNABLE or BLOCKED. 45 45 46 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, and follows its owner process in case of process migration.46 This implementation of ALMOS-MK does not support thread migration: a thread created by a pthread_create() system call 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. 47 47 48 48 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 a process descriptor P in a cluster K. This LTID index is allocated by the local process descriptor when the thread is created. … … 76 76 === 3.1) fork() === 77 77 78 The parent process P is running on a core in cluster K, and executes the fork() system call to create a new process C on a remote cluster Z that will become the owner of 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.78 The parent process P is running on a core in cluster K, and executes the fork() system call to create a new process C on a remote cluster Z, that will become the owner of 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. 79 79 80 80 1. the cluster K allocates memory in K for the reference process descriptor of C, and get a pointer on this process descriptor. 81 81 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. 82 82 1. after RPC completion, the kernel K initializes the C process descriptor from informations found in the P parent process descriptor. 83 1. the kernel K creates locally the main thread of process C, and register this thread in the TH_TBL(K, P),83 1. the kernel K creates locally the main thread of process C, and register this thread in the TH_TBL(K,C), 84 84 1. the kernel K register this new thread in the scheduler of the core executing the fork() system call, an return. 85 85