Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Performance & Tuning (http://www.baanboard.com/baanboard/forumdisplay.php?f=61)
-   -   Pid first free number (http://www.baanboard.com/baanboard/showthread.php?t=28028)

alejandro 31st August 2006 11: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 12: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 12: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 max.pid starting with this process pid.

Each 15 seconds, use get.var(max.pid + counter,"prog.name$",str.prog.name)
and counter descending till get.var returns 1.

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

Tahnak's

george7a 31st August 2006 13:35

Hi,

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 14:06

THAT IS.

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 07:18.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com