-   Performance & Tuning (
-   -   Pid first free number (

alejandro 31st August 2006 10:49

Pid first free number
Using ttstpshell you can list processes with ps comand.
If you open a session this new process appear with it`s pid.

The question is:

Can I know which is my first free pid number?
Alternative which is the higher pid number used?

Any predefined varaible?

NOTE: I do not want to use bshcmd6.x for this purpose.

Thank's in advance.

en@frrom 31st August 2006 11:07

I assume you want to use this in a program script. The predefined variable 'pid' contains the pid of the current process. If you will check the pid right in the before.program (for instance) of your script, you can be pretty sure that pid + 1 gives you the 'first free pid'...

May I ask what the purpose of your requirement is? I assume it has to do with starting a new subprocess...? There may be different (neater) ways to accomplish your requirements... So please specify...

alejandro 31st August 2006 11:39

What I want to know is if the user has started new sessions in a defined interval. This sessions can be closed at the time I want to know the first free pid.

The purpose is to check user activity.
It will be a background session running at certain intervals and check if the users has started new sessions. This sessions could be closed in this cut or opened; I only want to Know if pids are getting higher.

I have tried this:

Global variable with value starting with this process pid.

Each 15 seconds, use get.var( + counter,"$",
and counter descending till get.var returns 1.

It is not a start of the art method, but I do not find any better.


george7a 31st August 2006 12:35


You can use the pstat() function. It will show you all the current running processes with their PIDs, names and more...

I hope it helps,

- George

alejandro 31st August 2006 13:06


Sorry for my ignorance.
This function it is not in standard BaaN programers manual.

But yes it is in BaaNBoard.
Let us look more BaaNBoard.

Tahnk you.

All times are GMT +2. The time now is 02:52.

©2001-2018 - -