Reputation: 1007
I am taking an operating systems course and we have talked about what a process control block is, what is stored in it, what purpose it servers, and I understand all of that, but we didn't really touch on what data structure is actually used to make it. After googling it, I've come across two structures: either a linked list or an array is used. I realize that the structure could possible differ based on the operating system, but I was wondering exactly what data structures are used to create one, specifically in the Unix operating system (since I am using a Unix machine)?
Upvotes: 1
Views: 4983
Reputation: 19168
The doubly-linked list
data-structure is used 'generally' to implement Process Control Block! In UNIX also, the PCB is implemented as a doubly-linked list.
But,in case if your OS (talking about custom OS) is lightweight,then you can get off by using simpler data-structure like arrays! But,in general,PCB's are a very large data-structure and hence, advised to store in doubly-linked list which can be accommodated for any process to any level(storing all possible sort of info about process).
Also, check this answer of mine,here also I have mentioned in the last line the same answer...
Upvotes: 5