Sponsored Content
Top Forums Programming Count Number Of Threads in a Process Post 33170 by Perderabo on Wednesday 18th of December 2002 10:00:24 AM
Old 12-18-2002
What OS are you using? With SunOS 5.6, a simple "ls /proc/*/lwp" will show you all the threads.
 

10 More Discussions You Might Find Interesting

1. HP-UX

how to see the threads count of a process in hp unix?

hi,all: how to see the threads count of a process in hp unix? thanks (2 Replies)
Discussion started by: bugbugbug
2 Replies

2. Linux

Maximum number of threads handled by a process????

Hi Anybody knows max. no. of threads handled by a process in linux. Please reply Thanks in advnce :confused: (0 Replies)
Discussion started by: Agnello
0 Replies

3. UNIX for Advanced & Expert Users

Threads and Threads Count ?

Hi all, How can I get the list of all Threads and the Total count of threads under a particular process ? Do suggest !! Awaiting for the replies !! Thanks Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies

4. HP-UX

Need help. Unable to create threads after a certain number

Hi, I have a process which creates pthreads to generate some reports. After creating the reports these threads return null. But after 1024 threads, the process is not able to create any threads further.,and at max 5 threads are existing simultaneously and are returning the control back after... (2 Replies)
Discussion started by: Krsh
2 Replies

5. UNIX for Advanced & Expert Users

threads per process

What are the maximum number of threads possible per Process? Is it OS dependent? (1 Reply)
Discussion started by: digdarshan
1 Replies

6. Solaris

Number of threads running

Is there any command to find 1) the number of threads running 2) kernel boot mode in solaris box (2 Replies)
Discussion started by: vickylife
2 Replies

7. Shell Programming and Scripting

how to add the number of row and count number of rows

Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count The input file: 21 2341 A 21 2341 A 21 2341 A 21 2341 C 21 2341 C 21 2341 C 21 2341 C 21 4567 A 21 4567 A 21 4567 C ... (6 Replies)
Discussion started by: juelillo
6 Replies

8. AIX

How to list all threads in a running process

Hello, On Linux, I can use 'ps -efL | grep process_name' to list all threads that belong to a running process. -L has a different meaning on AIX and I could not find an equivalent flag in the man pages. Does anyone know of a way to dump the threads under a running process? Thanks,... (2 Replies)
Discussion started by: makodarear
2 Replies

9. SuSE

Configuring Number Threads

I have this error message from the logs of Zimbra email running on SUSE 11.2 Is the thread maximum of 20 an operating system parameter, or is it part of the application code, or part of the java run time? Part two, how would I increase that number? (3 Replies)
Discussion started by: jgt
3 Replies

10. HP-UX

How to get number of threads for single java process on HP-UX OS?

Hi All, When i was trying to get total number of threads per java process using this command ps -o NLWP PID, I'm not getting any output. Could someone help me in this issue. Thanks, GMar (1 Reply)
Discussion started by: mgangumolu
1 Replies
RUMP_LWPROC(3)						   BSD Library Functions Manual 					    RUMP_LWPROC(3)

NAME
rump_lwproc -- rump process/lwp management LIBRARY
rump kernel (librump, -lrump) SYNOPSIS
#include <rump/rump.h> int rump_pub_lwproc_rfork(int flags); int rump_pub_lwproc_newlwp(pid_t pid); void rump_pub_lwproc_switch(struct lwp *l); void rump_pub_lwproc_releaselwp(); struct lwp * rump_pub_lwproc_curlwp(); DESCRIPTION
In a normal operating system model a process is a resource container and a thread (lwp) is the execution context. Every lwp is associated with exactly one process, and a process is associated with one or more lwps. The current lwp (curlwp) indicates the current process and determines which resources, such as UID/GID, current working directory, and file descriptor table, are currently used. These basic princi- ples apply to rump kernels as well, but since rump uses the host's thread and process context directly, the rules for how thread context is determined are different. In the rump model, each host thread (pthread) is either bound to a rump kernel lwp or accesses the rump kernel with an implicit thread con- text associated with pid 1. An implicit thread context is created every time the rump kernel is entered and disbanded upon exit. While con- venient for occasional calls, creating an implicit thread uses a shared resource which can become highly contended in a multithreaded situa- tion. It is therefore recommended that dedicated threads are created. The association between host threads and the rump kernel curlwp is left to the caller. It is possible to create a dedicated host thread for every rump kernel lwp or multiplex them on top of a single host thread. After rump lwps have been created, switching curlwp is very cheap -- faster than a thread context switch on the host. In case multiple lwps/processes are created, it is the caller's responsibility to keep track of them and release them when they are no longer necessary. Like other rump kernel resources, procs/lwps will be released when the process hosting the rump kernel exits. rump_pub_lwproc_rfork() Create a process, one lwp inside it and set curlwp to the new lwp. The flags parameter controls how file descriptors are inherited from the parent. By default (flags=0) file descriptors are shared. Other options are: RUMP_RFFDG Copy file descriptors from parent. This is what fork(2) does. RUMP_RFCFDG File descriptors neither copied nor shared, i.e. new process does not have access to the parent's file descriptors. This routine returns 0 for success or an errno indicating the reason for failure. The new process id can be retrieved in the normal fashion by calling rump_sys_getpid(). rump_pub_lwproc_newlwp(pid) Create a new lwp attached to the process specified by pid. Sets curlwp to the new lwp. This routine returns 0 for success or an errno indicating the reason for failure. rump_pub_lwproc_switch(l) Sets curlwp to l. In case the new thread is associated with a different process than the current one, the process context is also switched. The special value NULL sets curlwp to implicit context. Switching to an already running lwp, i.e. attempting to use the same curlwp in two host threads simultaneously causes a fatal error. rump_pub_lwproc_releaselwp() Release curlwp and set curlwp to context. In case curlwp was the last thread inside the current process, the process container is also released. Calling this routine without a dedicated curlwp is a fatal error. rump_pub_lwproc_curlwp() Returns curlwp or NULL if the current context is an implicit context. SEE ALSO
getpid(2), rump(3) HISTORY
rump_lwproc first appeared in NetBSD 6.0. BSD
January 2, 2011 BSD
All times are GMT -4. The time now is 10:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy