Unix Technical Forum

Unix PIDS on AIX

This is a discussion on Unix PIDS on AIX within the AIX Operating System forums, part of the Unix Operating Systems category; --> I'm currently porting a large 'C' application from a Sequent platform (Dynix 4.4.7) to IBM AIX 5.2. The application ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2008, 09:22 PM
Vince Clarke
 
Posts: n/a
Default Unix PIDS on AIX

I'm currently porting a large 'C' application from a Sequent platform
(Dynix 4.4.7) to IBM AIX 5.2.

The application maintains a 30000 entry array which is used to store
the status of pid processes running on the system. The states of these
processes change depending on the activity of the process. However the
AIX system uses pids in the range 1 to ~4000000000. Clearly I can't
maintain such a large array in my system and need to find some way of
managing the problem.

The question I have is can the AIX kernel be configured so that it
will generate pids only in the range 1 to 30000 and therefore function
in a similar way to most other Unix systems. I have aked a number of
people about this even some from IBM and have not yet had a
satisfactory answer. I'm hoping someone here can provide a definitive
answer.

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 09:22 PM
Dan Foster
 
Posts: n/a
Default Re: Unix PIDS on AIX

In article <5f345ea8.0401190627.43959786@posting.google.com >, Vince Clarke <vincentfclarke@ntlworld.com> wrote:
> I'm currently porting a large 'C' application from a Sequent platform
> (Dynix 4.4.7) to IBM AIX 5.2.
>
> The application maintains a 30000 entry array which is used to store
> the status of pid processes running on the system. The states of these
> processes change depending on the activity of the process. However the
> AIX system uses pids in the range 1 to ~4000000000. Clearly I can't
> maintain such a large array in my system and need to find some way of
> managing the problem.


Why not? 0 to 4.2 billion can be represented as a single unsigned 32-bit
integer as a 'long' in C... I don't know the size of the array members, but
the process ID for 30,000 entries would be one 32-bit longword which would
occupy about 117KB of RAM alone, which doesn't seem bad. Even if a single
array member was about 30 bytes total times 30,000, that's still only 3.5
MB of RAM total...

You don't need to have it as array[pid]; it would be far more memory
efficient to maintain it as a singly or doubly-linked list, which isn't
hard or slow to traverse, especially if structured via binary tree insert,
traversal, or delete functions.

-Dan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-04-2008, 09:23 PM
Tao Chen
 
Posts: n/a
Default Re: Unix PIDS on AIX

Dan Foster wrote:

> You don't need to have it as array[pid]; it would be far more memory
> efficient to maintain it as a singly or doubly-linked list, which isn't
> hard or slow to traverse, especially if structured via binary tree insert,
> traversal, or delete functions.
>
> -Dan


Indeed. Sounds like the orignal design (assuming 30,000 at most, and
using fix-sized arrary) is bad.

Vince Clarke wrote:
> The question I have is can the AIX kernel be configured so that it
> will generate pids only in the range 1 to 30000 and therefore function
> in a similar way to most other Unix systems. I have aked a number of
> people about this even some from IBM and have not yet had a
> satisfactory answer. I'm hoping someone here can provide a definitive
> answer.


The answer is no.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:47 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com