aspose file tools
The moose likes Threads and Synchronization and the fly likes Process ID of current thread !!!!! URGENT !!!!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Process ID of current thread !!!!! URGENT !!!!!!!" Watch "Process ID of current thread !!!!! URGENT !!!!!!!" New topic
Author

Process ID of current thread !!!!! URGENT !!!!!!!

Meghana Reddy
Ranch Hand

Joined: Jan 29, 2002
Posts: 76
Hello,
How can i get the process ID that would be allocated by the JVM to any particular thread ?
ie
i've a java thread which invokes another thread and the INVOKING thread need to know the PROCESS ID of INVOKED thread. That means the invoked thread should return its own process id to the thread that invoked it.
is there any direct method in Java like getProcessID() which can directly return the current thread's process ID or is there any other way thru which i can know this...???
Its urgent.
Thanks in adv.
Meghana


Meghana Reddy
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Meghana,
Threads for a single VM all run in the same process space so their PID will be that of the java interpreter that starts the VM. I don't know of any method that will return the PID although the Process class probably should. It would be a simple matter to write some native code to do it, but of course that would not be a platform independant solution.
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process ID of current thread !!!!! URGENT !!!!!!!
 
Similar Threads
URGENT!!
urgent
Urgent
URGENT!!!
Urgent !