04-17-2008
Spawning multiple threads in Unix
Hi,
I need to spawn mutilpe threads , each invoking a different set of shell scripts, in parallel.
What would be the best way to do that.
Any sample script would greatly help. I am a novice at Unix so any help is much appreciated.
Thanks
10 More Discussions You Might Find Interesting
1. Programming
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT DEBIAN
spawn-fcgi
spawn-fcgi(1) General Commands Manual spawn-fcgi(1)
NAME
spawn-fcgi - Spawns FastCGI processes
SYNOPSIS
spawn-fcgi [options] [ -- <fcgiapp> [fcgi app arguments]]
spawn-fcgi -v
spawn-fcgi -h
DESCRIPTION
spawn-fcgi is used to spawn remote and local FastCGI processes.
While it is obviously needed to spawn remote FastCGI backends (the web server can only spawn local ones), it is recommended to spawn local
backends with spawn-fcgi, too.
Reasons why you may want to use spawn-fcgi instead of something else:
* Privilege separation without needing a suid-binary or running a server as root.
* You can restart your web server and the FastCGI applications without restarting the others.
* You can run them in different chroot()s.
* Running your FastCGI applications doesn't depend on the web server you are running, which allows for easier testing of other web
servers.
OPTIONS
spawn-fcgi accepts the following options:
-f <path>
Filename of the FastCGI application to spawn. This option is deprecated and it is recommend to always specify the application
(absolute path) and its parameters after "--"; the fcgiapp parameter is directly used for the exec() call, while for starting the
binary given with -f /bin/sh is needed (which may not be available in a chroot).
This option is ignored if fcgiapp is given.
-d <path>
Change the current directory before spawning the application.
-a <address>
IPv4/IPv6 address to bind to; only used if -p is given too. Defaults to "0.0.0.0" (IPv4).
-p <port>
TCP port to bind to; you cannot combine this with the -s option.
-s <path>
Path to the Unix domain socket to bind to; you cannot combine this with the -p option.
-C <children>
(PHP only) Number of children to spawn by setting the PHP_FCGI_CHILDREN environment variable. Default is not to overwrite the envi-
ronment variable; php will spawn no children if the variable is not set (same as setting it to 0).
-F <children>
Number of children to fork, defaults to 1. This option doesn't work with -n, have a look at multiwatch(1) if you want to supervise
multiple forks on the same socket.
-P <path>
Name of the PID file for spawned processes (ignored in no-fork mode)
-n No forking should take place (for daemontools)
-M <mode>
Change file mode of the Unix domain socket; only used if -s is given too.
-?, -h General usage instructions
-v Shows version information and exits
The following options are only available if you invoke spawn-fcgi as root:
-c <directory>
Chroot to specified directory; the Unix domain socket is created inside the chroot unless -S is given.
-S Create Unix domain socket before chroot().
-u User ID to change to.
-g Group ID to change to. Defaults to primary group of the user given for -u.
-U Change user of the Unix domain socket, defaults to the value of -u. (only used if -s is given)
-G Change group of the Unix domain socket, defaults to the primary group of the user given for -U; if -U wasn't given, defaults to the
value of -g. (only used if -s is given)
SEE ALSO
svc(8), supervise(8), see http://cr.yp.to/daemontools.html
multiwatch(1), see http://cgit.stbuehler.de/gitosis/multiwatch/about/
26 March 2009 spawn-fcgi(1)