Sponsored Content
Top Forums Shell Programming and Scripting Spawning multiple threads in Unix Post 302186551 by matrixmadhan on Thursday 17th of April 2008 01:39:08 PM
Old 04-17-2008
a better design / approach would be

( which sometimes may not be the case you are looking for )

have a controller script and it should decide the number of threads to spawn based on throttling, current load, load database that it could with stand and several other factors

also this controller script should receive success / failure message from the instance which it is spawning so that decisions could be taken based on the decision

controller script should be able to collate the results; fluctuate the number of instances running at any point of time..

this might be too much for your requirement, but if you see a pattern of running such tasks in parallel most of the time, this should be a good to go way Smilie
 

10 More Discussions You Might Find Interesting

1. Programming

How to use pipe() in multiple threads?

Hi, I have a program that runs two threads in stead of two processes. I want to use pipe to redirect the output of the first thread to the input of the second thread. One thread is continuously writing to a pipe, and the other thread will read from the pipe. How do I do that? Is there... (2 Replies)
Discussion started by: wminghao
2 Replies

2. Programming

synchronizing multiple threads in unix

hi all! I wanted to know how to synchronize multiple threads in unix It would be better if someone give some code samples Thanx (1 Reply)
Discussion started by: bankpro
1 Replies

3. IP Networking

How to choose Multiple process or Multiple threads?

Hi All, Please explain me when i have to use multiple process and when I have to use Multiple threads? Please give me an example.It will be very helpful for me. Thanks in advance. (0 Replies)
Discussion started by: ashleykumar
0 Replies

4. Programming

spawning multiple processes spread across two files

I want to spawn n child processes but have two different classes..with the foremost one forking/spawning the child process and the latter performing a function w/ the spawned processes. I can do this in one class with an if statement and the simple if((pid=fork())==0) //child process { ... (1 Reply)
Discussion started by: StrengthThaDon
1 Replies

5. UNIX for Advanced & Expert Users

Crontab spawning multiple at processes

Hi - I need help. My user crontab is spawning multiple at processes (and multiple mencoder program starts, that exit, then restart, repeatedly), locking up my system. For example I have this entry in my crontab: $ sudo crontab -u victoria -e * * * * * ~/recordings/pvr1 * * * * *... (10 Replies)
Discussion started by: gstuart
10 Replies

6. UNIX for Advanced & Expert Users

Help! imapd is spawning multiple processes, all of a sudden, for no reason!

Hi All, I need some assistance, if possible... Our IMAP server has recently (as of 10:30 GMT today) started spawning multiple processes for no reason! This is causing the mail server's load average to increase continually until the whole machine grinds to a halt. Here is a typical... (0 Replies)
Discussion started by: fishsponge
0 Replies

7. Shell Programming and Scripting

How to make this run in multiple threads

Hi, I have a list of URLs in a csv file which I'm checking for page status. It just prints the URL and the status as output. This works perfectly fine. I'm looking to run this in multiple threads to make this process faster. I'm pretty new to Perl and I managed to complete this. It would be... (9 Replies)
Discussion started by: kzenthil
9 Replies

8. AIX

Multiple pconsole processes spawning indefinetly

Good night everyone, I've been trying to make AD authentication work with RBAC and I think I messed my test LPAR up. I've manually modified the /etc/security/user.roles file, adding a role to one of my AD users (who is not defined locally) and then runned setkst. It worked fine, but now I found... (3 Replies)
Discussion started by: Janpol
3 Replies

9. Shell Programming and Scripting

How to start multiple threads in Solaris?

Hello, In a unix Solaris environment, (for simulation) how to start multiple threads (as Light Weight Process, not background process)? thanks, J. (7 Replies)
Discussion started by: seafan
7 Replies

10. Shell Programming and Scripting

Need to create multiple threads

Hi , i need to run multiple scripts parallely ,on my server....i have 8 cpus . planning to run minimum of 6 scripts paralley ....could you please suggest someone . thanks in advance , (3 Replies)
Discussion started by: Huvan
3 Replies
rsm_get_controller(3RSM)			      Remote Shared Memory Library Functions				  rsm_get_controller(3RSM)

NAME
rsm_get_controller, rsm_get_controller_attr, rsm_release_controller - get or release a controller handle SYNOPSIS
cc [ flag... ] file... -lrsm [ library... ] #include <rsmapi.h> int rsm_get_controller(char *name, rsmapi_controller_handle_t *controller); int rsm_get_controller_attr(rsmapi_controller_handle_t chdl, rsmapi_controller_attr_t *attr); int rsm_release_controller(rsmapi_controller_handle_t chdl); DESCRIPTION
The controller functions provide mechanisms for obtaining access to a controller, determining the characteristics of the controller, and releasing the controller. The rsm_get_controller() function acquires a controller handle through the controller argument. The name argument is the specific con- troller instance (for example, "sci0" or "loopback"). This controller handle is used for subsequent RSMAPI calls. The rsm_get_controller_attr() function obtains a controller's attributes through the attr argument. The chdl argument is the controller handle obtained by the rsm_get_controller() call. The attribute structure is defined in the <rsmapi> header. The rsm_release_controller() function releases the resources associated with the controller identified by the controller handle chdl, obtained by calling rsm_get_controller(). Each rsm_release_controller() call must have a corresponding rsm_get_controller() call. It is illegal to access a controller or segments exported or imported using a released controller. RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error. ERRORS
The rsm_get_controller(), rsm_get_controller_attr(), and rsm_release_controller() functions can return the following errors: RSMERR_BAD_CTLR_HNDL Invalid controller handle. The rsm_get_controller() and rsm_get_controller_attr() functions can return the following errors: RSMERR_BAD_ADDR Bad address. The rsm_get_controller() function can return the following errors: RSMERR_CTLR_NOT_PRESENT Controller not present. RSMERR_INSUFFICIENT_MEM Insufficient memory. RSMERR_BAD_LIBRARY_VERSION Invalid library version. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ |ATTRIBUTE TYPE |ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
rsm_memseg_export_create(3RSM), rsm_memseg_import_connect(3RSM), attributes(5) SunOS 5.11 8 Jun 2001 rsm_get_controller(3RSM)
All times are GMT -4. The time now is 06:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy