Hi,
My questions are about Process ID, Process Control Block (PCB), and
Process Table (PT), and thread table
My old notes state that:
1- Each Process is allocated an identifier: Process ID (PID)
2- The PID indexes a process Table (PT)
3- Each process table entry contains a pointer to a relevant process 'PCB
However, this link
http://foldoc.org/?query=process+table&action=Search
states instead that every process has an entry in the table. These
entries are known as process control blocks.
So I am just wondering, are the process table entries pointers to the
processes' PCB or rather the PCBs contents?
I think these entries include (among others) pointers to the PCBs
considering the latter expected size.
A second question do we use any hashing to index the process table
since the PIDs values seem not be allocated sequentially
Actually how PID values are allocated and how are they used to index
the process table (and afterwards the PCBs)
at the end, i presume that each process pcb contains a pointer to the
process thread table and that the thread table has more and less the
same structure than the process table, exempt that PCB contents is
different from Thread control block
Many thanks for your assistance
Process Table-Process Control Block
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: Process Table-Process Control Block
I guess it can be either. There is advantages and disadvantages with either setup. My OS has a table with pointers to each PCB sitting in the kernel heap.
For me I find this configuration to use less memory with less processes and it makes it easier to allocate space for new PCBs in the table (look for a table entry set to null and fill it with a pointer).
But I don't have my PID indexing the PCB table. Instead my PID is stored in the PCB itself. I did this because I choose my PID by incrementing a counter and assigning the result. This method means that old PIDs aren't reused (accountability).
To index my PCB table I use a number which is internal to the kernel, and that is the index into the GDT that the TSS/PCB sits in. My only overhead with this configuration is that I have to convert PID->GDTID and back every now and then but it makes programming easier in some cases.
For me I find this configuration to use less memory with less processes and it makes it easier to allocate space for new PCBs in the table (look for a table entry set to null and fill it with a pointer).
But I don't have my PID indexing the PCB table. Instead my PID is stored in the PCB itself. I did this because I choose my PID by incrementing a counter and assigning the result. This method means that old PIDs aren't reused (accountability).
To index my PCB table I use a number which is internal to the kernel, and that is the index into the GDT that the TSS/PCB sits in. My only overhead with this configuration is that I have to convert PID->GDTID and back every now and then but it makes programming easier in some cases.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein