0

I'm using the java.util.concurrent.ExecutorService library to implement multithreading and it works good, Now i need to store every started thread LWP: An LWP is the unit of a basic execution context. (which i get using the following command line )

amira@amira:~/workspace/XXX/XXX/Generator$ ps -lf -L
F S UID        PID  PPID   LWP  C NLWP PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
0 R amira     3702  8646  3702  0    1  80   0 -  1229 -      09:46 pts/3    00:00:00 ps -lf -L
0 S amira     8646 26393  8646  0    1  80   0 -  2884 wait   Dec23 pts/3    00:00:00 /bin/bash

in a database because we will need it to make statistics and solve bugs. So how to retrieve it in my code.

Thank you in advance

Amira
  • 3,184
  • 13
  • 60
  • 95
  • 1
    Java intends to abstract this away from you. – William Price Dec 24 '14 at 08:57
  • 1
    "An LWP is the unit of a basic execution context" <-- nosir. This is OS dependent. With Linux, for instance, the most basic execution context is a product of `clone(2)`. The only differences between the parent and the child is what the parent chooses what the child will share with it. As it happens, all of `fork()`, `vfork()` and `pthread_create()` use `clone()` behind the scenes. – fge Dec 24 '14 at 08:58
  • possible duplicate of [Obtaining the thread ID for Java threads in Linux](http://stackoverflow.com/questions/11224394/obtaining-the-thread-id-for-java-threads-in-linux) – William Price Dec 24 '14 at 09:01

0 Answers0