Reputation: 1371
what is the exact difference between process control block
and process descriptor
?.
I was reading about kernel of linux. It was written that there is some thread_info
structure which contains the pointer to actual process descriptor table. It was written that the thread_info
lies just above/below of kernel stack. So definitely thread_info
is in main memory. But what about actual process descriptor task_struct
? where is it located? If process descriptor resides in main memory, where is the actual place for it ?
Upvotes: 0
Views: 4044
Reputation: 11
In the kernel, the process descriptor is a structure called task_struct, which keeps track of process attributes and information. All kernel information regarding a process is found there.
Upvotes: 1
Reputation: 5706
The thread_info
and task_struct
structures are just two different structures that hold different pieces of information about a thread, with the thread_info
holding more architecture-specific data than the task_struct
. It makes more sense to split up the information rather than keep it all in the same structure. (Although you could put them in the same struct; the 2.4 Linux kernel did this.)
How those structs are allocated depends on the architecture you're using. The relevant functions you want to examine are alloc_task_struct()
and alloc_thread_info()
.
Upvotes: 3