Get the no. of threads spawned in a C program


 
Thread Tools Search this Thread
Top Forums Programming Get the no. of threads spawned in a C program
# 8  
Old 09-25-2008
Got it. Thank you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh behavior in scripts spawned w/nohup

I have a need to run any number of identical scripts simultaneously, so I've created a driver script which reads a template script, edits these appropriately and then submits them via nohup. The spawned scripts all check to see at some point how many of their number are running and once the count... (7 Replies)
Discussion started by: safedba
7 Replies

2. Shell Programming and Scripting

Storing received value from send, spawned telnet session

Hi Guys, I'm completely new to bash and trying to write a script to spawn a telnet session to retrieve the RSSI value of my device and log the average value of the RSSI over 20 samples. I know that my command does return the RSSI value successfully but my bash scripting is letting me down. I'm... (5 Replies)
Discussion started by: bwkm
5 Replies

3. Shell Programming and Scripting

Process behavior different when spawned from single terminal

So this one just plain confuses me. I have a bunch of somewhat CPU intensive processes that all communicate using a shared memory region. Some of these programs are threaded and some also change the scheduling to FIFO or round robin. The good news is that everything works as long as I spawn... (3 Replies)
Discussion started by: talkingfennel
3 Replies

4. Shell Programming and Scripting

Preparing a list of spawned processes

Hi All I'm currently trying to develop a script which will find the child processes of a process ID already passed to the script. I then need the script to look for spawned processes of these child processes and so on until it can't find any more. For example At the moment, I have to... (6 Replies)
Discussion started by: huskie69
6 Replies

5. Shell Programming and Scripting

Suppressing output of a spawned telnet process

Hi, I'm trying to spawn a telnet process and trying to do some actions in the remote host using expect script. I would like to know how to suppress all the output in order the user using the script should not be able to see any actions done on the remote host. I tried using the "log_user 0"... (8 Replies)
Discussion started by: arun_maffy
8 Replies

6. UNIX for Dummies Questions & Answers

Finding apache process id that is spawned by a wget

Hi, I have a situation where I am writing a programme that runs a series of long running PHP scripts that can take anything from 20 minutes to 10 hours to execute. I have a solution half implemented where I use via php exec(wget <location to command>) and get the process id back. This... (1 Reply)
Discussion started by: mrploddy
1 Replies

7. Programming

In unix how we can test or check race condition in a c program by using multi threads

In unix how we can test or check race condition in any c program by using multi thread programming (1 Reply)
Discussion started by: afroze
1 Replies

8. Programming

In unix how we can test or check race condition in c program by using multi threads

In unix how we can test or check race condition in any c program by using multi thread programming (5 Replies)
Discussion started by: afroze
5 Replies

9. UNIX for Dummies Questions & Answers

In unix how we can test or check race condition in a c program by using multi threads

In unix how we can test or check race condition in any c program by using multi thread programming (1 Reply)
Discussion started by: afroze
1 Replies

10. Linux

In unix how we can test or check race condition in c program by using multi threads

In unix how we can test or check race condition in any c program by using multi thread programming (1 Reply)
Discussion started by: afroze
1 Replies
Login or Register to Ask a Question
XInitThreads(3) 						  XLIB FUNCTIONS						   XInitThreads(3)

NAME
XInitThreads, XLockDisplay, XUnlockDisplay - multi-threading support SYNTAX
Status XInitThreads(void); void XLockDisplay(Display *display); void XUnlockDisplay(Display *display); ARGUMENTS
display Specifies the connection to the X server. DESCRIPTION
The XInitThreads function initializes Xlib support for concurrent threads. This function must be the first Xlib function a multi-threaded program calls, and it must complete before any other Xlib call is made. This function returns a nonzero status if initialization was suc- cessful; otherwise, it returns zero. On systems that do not support threads, this function always returns zero. It is only necessary to call this function if multiple threads might use Xlib concurrently. If all calls to Xlib functions are protected by some other access mechanism (for example, a mutual exclusion lock in a toolkit or through explicit client programming), Xlib thread ini- tialization is not required. It is recommended that single-threaded programs not call this function. The XLockDisplay function locks out all other threads from using the specified display. Other threads attempting to use the display will block until the display is unlocked by this thread. Nested calls to XLockDisplay work correctly; the display will not actually be unlocked until XUnlockDisplay has been called the same number of times as XLockDisplay. This function has no effect unless Xlib was successfully initialized for threads using XInitThreads. The XUnlockDisplay function allows other threads to use the specified display again. Any threads that have blocked on the display are allowed to continue. Nested locking works correctly; if XLockDisplay has been called multiple times by a thread, then XUnlockDisplay must be called an equal number of times before the display is actually unlocked. This function has no effect unless Xlib was successfully ini- tialized for threads using XInitThreads. SEE ALSO
Xlib - C Language X Interface X Version 11 libX11 1.2.1 XInitThreads(3)