02-29-2012
Thanks, can you tell me how to do it in perl.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go?
Thank you
Richard (4 Replies)
Discussion started by: ukndoit
4 Replies
2. Programming
Hello,
How many child processes are actually created when running this code ?
#include <signal.h>
#include <stdio.h>
int main () {
int i ;
setpgrp () ;
for (i = 0; i < 10; i++) {
if (fork () == 0) {
if ( i & 1 ) setpgrp () ;
printf ("Child id: %2d, group: %2d\n", getpid(),... (0 Replies)
Discussion started by: green_dot
0 Replies
3. Shell Programming and Scripting
Hello,
How many child processes are actually created when running this code ?
#include <signal.h>
#include <stdio.h>
int main () {
int i ;
setpgrp () ;
for (i = 0; i < 10; i++) {
if (fork () == 0) {
if ( i & 1 ) setpgrp () ;
printf ("Child id: %2d, group: %2d\n",... (1 Reply)
Discussion started by: green_dot
1 Replies
4. Solaris
Hi
Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages.
Any free tools or scripts to do this?
Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies
5. SCO
Dear experts,
I have done a re-installation of sco unix openserver 5.0.5 and managed to create users. The problem am facing is that of one user logging in more than 5 times. How can i overcome this problem. the system give the error below.
-sh: fork failed - too many processes in sco unix... (5 Replies)
Discussion started by: njoroge
5 Replies
6. UNIX for Dummies Questions & Answers
Disclaimer: This is just a rainy day experiment. There is no expected "goal" other than to understand UNIX better.
After reading about fork and exec, my understanding is that forking, as the UNIX shell does by design, consequentially may sacrafice some speed versus an approach that runs in... (1 Reply)
Discussion started by: uiop44
1 Replies
7. Programming
Hi friends,
I have a small question regarding unix system call fork, I hope you will solve my problem. Here is the small program
$ cat fork1.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
int pid;
int x = 0;
x = x + 1;
pid = fork();
if(pid < 0)
{... (2 Replies)
Discussion started by: gabam
2 Replies
8. Programming
Hello people
I need help
How to make ONE process to create MORE (not one) processes with fork(). I tried several codes but do not work.
Thanks (8 Replies)
Discussion started by: nekoj
8 Replies
9. Programming
Hi guys!
I'll simplify my problem. I have the following code:
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/wait.h>
#define max 25
#define buffdim 50
void p1();
void p2();... (2 Replies)
Discussion started by: pfpietro
2 Replies
10. Shell Programming and Scripting
Can anyone help me with this?
Create a parent process that gets from the command line n arguments arg1, arg2, ... , argn.
The parent will create n/3 son processes, each of them will create a file with the name argi by concatenate the files argi+1 and argi+2.
How can i concatenate those... (1 Reply)
Discussion started by: bunicu01
1 Replies
LEARN ABOUT PLAN9
rendezvous
RENDEZVOUS(2) System Calls Manual RENDEZVOUS(2)
NAME
rendezvous - user level process synchronization
SYNOPSIS
#include <u.h>
#include <libc.h>
ulong rendezvous(ulong tag, ulong value)
DESCRIPTION
The rendezvous system call allows two processes to synchronize and exchange a value. In conjunction with the shared memory system calls
(see segattach(2) and fork(2)), it enables parallel programs to control their scheduling.
Two processes wishing to synchronize call rendezvous with a common tag, typically an address in memory they share. One process will arrive
at the rendezvous first; it suspends execution until a second arrives. When a second process meets the rendezvous the value arguments are
exchanged between the processes and returned as the result of the respective rendezvous system calls. Both processes are awakened when the
rendezvous succeeds.
The tag space is common to processes in the same file name space, so rendezvous only works between processes in the same file name space.
If a rendezvous is interrupted the return value is ~0, so that value should not be used in normal communication.
SOURCE
/sys/src/libc/9syscall
SEE ALSO
segattach(2), fork(2)
DIAGNOSTICS
Sets errstr.
BUGS
The correlation of rendezvous tags and file name space is a historical accident. If two unrelated processes happen to be in the same name
space and do a rendezvous, trouble will result. The solution is to call rfork(RFNAMEG) (see fork(2)) in programs that use rendezvous
unless they need to share the name space with their parent. This is especially important in Alef programs.
RENDEZVOUS(2)