03-30-2004
Thank you for the sample code, I was discussing pipes with one of my colleagues and it is seems that when a read is being performed on a pipe the OS performs a blocking operation or a blocking operation takes place and because of this, all the processes can be coordinated amongst themselves to perform the tasks that were previously outlined. Can someone shed some light on this if possible.
Thanks,
FG
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear all,
suppose that I start a process (named "father"). "father" starts in turns a process called "child" with an execv call (after a fork). In this way "father" will be notified if "chlid" crashes (SIGCHILD mechanism). The problem is:
if "father" crashes, how can I do to be recreate a... (1 Reply)
Discussion started by: npalmentieri
1 Replies
2. UNIX for Dummies Questions & Answers
I don't follow what these are...
this is what my text says...
"When a process is started, a duplicate of that process is created. This new process is called the child and the process that created it is called the parent. The child process then replaces the copy for the code the parent... (1 Reply)
Discussion started by: xyyz
1 Replies
3. Shell Programming and Scripting
Hello.
I have a global function name func1() that I am sourcing in from script A. I call the function from script B. Is there a way to find out which script called func1() dynamically so that the func1() can report it in the event there are errors?
Thanks (2 Replies)
Discussion started by: yoi2hot4ya
2 Replies
4. 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
5. 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
6. UNIX for Advanced & Expert Users
Hi,
Is there a way I can kill all the child processes of a process, given its process id.
Many thanks in advance.
J. (1 Reply)
Discussion started by: superuser84
1 Replies
7. Programming
All,
Ok...so I know I *should* be able to control a process's stdin and stdout from the parent by creating pipes and then dup'ing them in the child. And, this works with all "normal" programs that I've tried. Unfortunately, I want to intercept the stdin/out of the scp application and it seems... (9 Replies)
Discussion started by: DreamWarrior
9 Replies
8. Windows & DOS: Issues & Discussions
I have a .NET application that remotely starts, stops, and gets status of Windows services and scheduled tasks. I would like to add the capability of starting, stopping, and getting status of remote AIX applications also. Based on some preliminary research, one option may be to use 3rd party .NET... (0 Replies)
Discussion started by: auser1
0 Replies
9. Shell Programming and Scripting
I am trying to implement the below using Ksh script on a Lx machine.
There is a file(input_file) with 100K records. For each of these records, certain script(process_rec) needs to be called with the record as input. Sequential processing is time-consuming and parallel processing would eat up... (2 Replies)
Discussion started by: APT_3009
2 Replies
10. Shell Programming and Scripting
is there a universal way of getting the children of a particular process? i'm looking for a solution that works across different OSes...linux, aix, sunos, hpux.
i did a search online and i kept finding answers that were specific to Linux..i.e. pstree.
i want to be able to specify a process... (2 Replies)
Discussion started by: SkySmart
2 Replies
LEARN ABOUT DEBIAN
renice
RENICE(1) User Commands RENICE(1)
NAME
renice -- alter priority of running processes
SYNOPSIS
renice [-n] priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...]
renice -h | -v
DESCRIPTION
Renice alters the scheduling priority of one or more running processes. The following who parameters are interpreted as process ID's,
process group ID's, or user names. Renice'ing a process group causes all processes in the process group to have their scheduling priority
altered. Renice'ing a user causes all processes owned by the user to have their scheduling priority altered. By default, the processes to
be affected are specified by their process ID's.
Options supported by renice:
-n, --priority
The scheduling priority of the process, process group, or user.
-g, --pgrp
Force who parameters to be interpreted as process group ID's.
-u, --user
Force the who parameters to be interpreted as user names.
-p, --pid
Resets the who interpretation to be (the default) process ID's.
-v, --version
Print version.
-h, --help
Print help.
For example,
renice +1 987 -u daemon root -p 32
would change the priority of process ID's 987 and 32, and all processes owned by users daemon and root.
Users other than the super-user may only alter the priority of processes they own, and can only monotonically increase their ``nice value''
(for security reasons) within the range 0 to PRIO_MAX (20), unless a nice resource limit is set (Linux 2.6.12 and higher). The super-user
may alter the priority of any process and set the priority to any value in the range PRIO_MIN (-20) to PRIO_MAX. Useful priorities are: 20
(the affected processes will run only when nothing else in the system wants to), 0 (the ``base'' scheduling priority), anything negative (to
make things go very fast).
FILES
/etc/passwd to map user names to user ID's
SEE ALSO
getpriority(2), setpriority(2)
BUGS
Non super-users can not increase scheduling priorities of their own processes, even if they were the ones that decreased the priorities in
the first place.
The Linux kernel (at least version 2.0.0) and linux libc (at least version 5.2.18) does not agree entirely on what the specifics of the sys-
temcall interface to set nice values is. Thus causes renice to report bogus previous nice values.
HISTORY
The renice command appeared in 4.0BSD.
AVAILABILITY
The renice command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux November 2010 util-linux