Run 4-processes concurrently


 
Thread Tools Search this Thread
Top Forums Programming Run 4-processes concurrently
# 1  
Old 02-06-2006
Run a background process

How can i run a back ground process....

I.e for example by using fork() i need to run seperate 4 background processes..
How can send a process to background

???
# 2  
Old 02-06-2006
1) If the process is already running,
Press Ctrl + z to suspend it and then give the following command
bg + job number

2) while starting the process follow it with an ampersand

command &
# 3  
Old 02-07-2006
Run more than 2 background processes

How to run 4 seperate processes in the background, concurrently...
(I.E as background processes.)
by using fork().

(Something like... one parent & 4 concurrently running children)
# 4  
Old 02-08-2006
Fork the main process four times and do exec after forking....
is not that what you are looking for ?
# 5  
Old 02-26-2006
Run 4-processes concurrently

I need to run 4-processes concurrently in the background.
(I.eSmiliene parent with 4 concurrently running children.All 4 children should be in the same level.)

Parent
|
|
------- - - - - ----
| | | |
c1 c2 c3 c4 (same level)

I tried like this(code below)...But it doen't do what i want.Pls help me with this code. How can i

do this...
Is there any other easy way of doing this.....?


#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

#define NUM_CHILDREN 4
pid_t children[NUM_CHILDREN];
int i;

for(i=0;i<NUM_CHILDREN;i++){
if( (children[i]=fork()) == 0 ){
sleep(5);/**/
}
sleep(8);/**/
}

How can i verify that there are 4 concurrent processes running in the background?
(Is 'pstree' command OR any other better way! )
# 6  
Old 03-01-2006
PHP how to differentiate processes...

how to differentiate processes

If there are 1-parent & 4-concurrent same level children, how to differntiate those Processes.

I.e: 4 child processes should able to call diffenent functions.

Child1 should call function-A while
Child2 should call function-B
Child3 should call function-c
Child4 should call function-D


Can i use pid of processes to do this...
If so how???

Are there any other method.
# 7  
Old 03-01-2006
Question exec header file

hello..
is anyone can help me? what is header file of the six exec's process plzzz...?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run feeding each other processes simultaneously?

Hello, I need to run multiple shell processes simultaneously and output of the first process shall be the input of the second process but first process is never ending so both should be running in parallel. I do not wish to wait the end of the first process. I am under ubuntu 16.04. ... (3 Replies)
Discussion started by: baris35
3 Replies

2. UNIX for Dummies Questions & Answers

Maximum no of processes that can run

Is there any limit in UNIX that only a MAXIMUM no of processes can run at a time? If so, it exceeds then what would be the error we would receive? (4 Replies)
Discussion started by: jansat
4 Replies

3. UNIX for Dummies Questions & Answers

How to run script concurrently

Hi all, I have one script. Its job is to get 1 file from dirA and 1 file from dirB as parameters for another python script. However, there are a lot of files in both dir A and B, so running this scripts really takes a lot of time. So I wonder if there are any ways that I can do this faster,... (6 Replies)
Discussion started by: yoyomano
6 Replies

4. UNIX and Linux Applications

how to run more than two processes parallely

I would like to call a function called CIRCLE which is further beind called by other function but in a loop that CIRCLE fuction is being called. And this CIRCLE function starts another process which takes 3 hours to complete again, if i put that process in nohup &, I can go to the next command... (2 Replies)
Discussion started by: venugopalsmartb
2 Replies

5. Shell Programming and Scripting

kill my processes which are run by hacker

how can I kill my processes which are run by hacker or another person who log in with my username and password (1 Reply)
Discussion started by: thsecmaniac
1 Replies

6. Programming

how to run socket programme and file management concurrently

hi i have a server socket programme which is running in HP/UX system and then need to add a function about refreshing memory every miniute because the socket programme is blocked , i have no idea about this what should i do thanks (10 Replies)
Discussion started by: benbenpig
10 Replies

7. UNIX for Advanced & Expert Users

script to run different shells which run different processes

Hi, Would like to ask the experts if anyone knows how to run a script like this: dtterm -title shell1 run process1 on shell1 dtterm -title shell2 run process2 on shell2 cheers! p/s: sorry if i used the wrong forum, quite concussed after watching world cup for several nights; but I... (2 Replies)
Discussion started by: mochi
2 Replies

8. UNIX for Advanced & Expert Users

Run away processes

Hi, My server runnning on SUN Solaris rel.5.5.1. I have been facing this issues for years. I have some Xbase databases running on the server. User is using emulation software to telnet to server for accessing application. If user logout application abnormally - by closing windows session, then... (2 Replies)
Discussion started by: lowtaiwah
2 Replies

9. UNIX for Advanced & Expert Users

preventing others to run processes on my machine

I am in a multi-user Linux environment at work. Other users easily run processes on my machine when my machine is idle, but when I try to use my machine, it is dead slow. The processes run by them always grab the top spot using 99% of my CPU time. Is there a way I can prevent others to run... (3 Replies)
Discussion started by: besharam
3 Replies

10. Shell Programming and Scripting

How to run processes in parallel?

In a korn shell script, how can I run several processes in parallel at the same time? For example, I have 3 processes say p1, p2, p3 if I call them as p1.ksh p2.ksh p3.ksh they will run after one process finishes. But I want to run them in parallel and want to display "Process p1... (3 Replies)
Discussion started by: sbasak
3 Replies
Login or Register to Ask a Question