Thread: Using a table to store PCB information?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    119

    Using a table to store PCB information?

    I've been reading up on operating systems and trying to understand the flury of information i'm digesting. This question pertains to storing PCB's. What are the benefits and limitations of storing Process Control Blocks in a table (array) data structure? And I don't understand how someone would implement a queue of processes using the table...

    Benefits:
    -Faster access time
    -Blocks in order

    Limitations:
    -Pre-defined size

    Can anyone help me figure out some more?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > And I don't understand how someone would implement a queue of processes using the table
    Unlike a traditional linked list, using a next pointer, a linked list through an array could be done using a next subscript.

    It could even be done using pointers, with
    array[n].next = &array[m];

    The table size is fixed to prevent run-away creation of processes implementing a DoS attack.

    A pre-allocated table means you're always sure of being able to create the number of resources which could be created.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Also, using a predefined table size for process control blocks will prevent the need to allocate memory dynamically inside the process creation code.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Group Project Help/Volunteer
    By DarkDot in forum C++ Programming
    Replies: 3
    Last Post: 04-24-2007, 11:36 PM
  2. Sorting a table and saving a table help!!!
    By MrMe913 in forum C Programming
    Replies: 4
    Last Post: 04-18-2007, 12:19 PM
  3. Store information
    By Livijn in forum C++ Programming
    Replies: 14
    Last Post: 04-16-2007, 03:06 PM
  4. rehash help
    By kashifk in forum C++ Programming
    Replies: 1
    Last Post: 10-22-2003, 06:51 PM
  5. help with operator <
    By kashifk in forum C++ Programming
    Replies: 1
    Last Post: 10-21-2003, 03:49 PM