LOG-MANAGER process and thread

Posted by alextrs on 16-Nov-2010 14:58

Hi Guys,

Is there any way how you can get the values of processID and threadID (P-005448 T-004740) from your program?

Thank you!

All Replies

Posted by Admin on 16-Nov-2010 15:10

Which platform and which version of Progress?

10.2B GUI on Windows:

MESSAGE System.Diagnostics.Process:GetCurrentProcess ():Id

VIEW-AS ALERT-BOX INFO BUTTONS OK.

I don't think the Thread ID is relevant for the Progress client - since it's single threaded.

Posted by alextrs on 16-Nov-2010 15:21

Thank you, but unfortunately we still on OpenEdge 10.1C04

I don't think the Thread ID is relevant for the Progress client - since it's single threaded.

I want to use this in my "LOG-MANAGER" to see which AppServer agent made changes. Since LOG-MANAGER:LOGFILE-NAME cannot be changed in AppServer env, I need to "Reinvent the wheel" and design my own log-manager (for my specific task).

Thank you!

Posted by Aliaksandr Tarasevich on 24-Nov-2010 12:27

In Windows you can get these values using this:

/* Get Process ID */

PROCEDURE GetCurrentProcessId EXTERNAL "Kernel32.dll":
    DEFINE RETURN PARAMETER viProcessID AS LONG.
END.

/* Get Thread ID   */

PROCEDURE GetCurrentThreadId EXTERNAL "Kernel32.dll":
    DEFINE RETURN PARAMETER viProcessID AS LONG.
END.

Posted by Thomas Mercer-Hursh on 24-Nov-2010 12:39

One can find a lot of that sort of thing here http://www.oehive.org/win32api

One might want a different return variable for the second one.

Getting the equivalent in Unix is very straightforward.

But, note Mike's dubiousness about the usefulness of thread ID in a single threaded AVM.

This thread is closed