in reply to Controlling Shared Memory Id's

Thanks Tilly,

Good plans of attack... I like it.

The Perl executes a commercial .exe which I cannot modify so keeping a record of initialization time would be best for me.

The control loop added 1-2 to the machines load. I thought this was caused by more instances of the command line interface. I thought the performance benefit of quickly removing supposedly unused shm id's was worth the trade off.

Replies are listed 'Best First'.
RE (tilly) 2: Controlling Shared Memory Id's
by tilly (Archbishop) on Sep 14, 2000 at 02:46 UTC
    The machine's load is the average number of processes that were ready to run when the scheduler went to allocate a time slice.

    That will rise 1 because either your script or the shells it launches can always run. And you may add a bit more because other processes will spend time waiting that they would have spent running.

    Unless these instances are being launched at a crazy speed, you will probably find sleeping 1 second in the loop to be well worthwhile. Even if they are launched fast, tossing in a select(undef,undef,undef,0.05) will still drop your load substantially and get rid of them quickly.