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
???
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. UNIX for Advanced & Expert Users
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
3. UNIX for Advanced & Expert Users
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
4. UNIX for Advanced & Expert Users
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
5. Programming
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
6. Shell Programming and Scripting
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
7. UNIX and Linux Applications
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
8. UNIX for Dummies Questions & Answers
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
9. UNIX for Dummies Questions & Answers
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
10. Shell Programming and Scripting
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
LEARN ABOUT OSX
setpriority
GETPRIORITY(2) BSD System Calls Manual GETPRIORITY(2)
NAME
getpriority, setpriority -- get/set program scheduling priority
SYNOPSIS
#include <sys/resource.h>
int
getpriority(int which, id_t who);
int
setpriority(int which, id_t who, int prio);
DESCRIPTION
The scheduling priority of the process, process group, or user as indicated by which and who is obtained with the getpriority() call and set
with the setpriority() call. Which is one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and who is interpreted relative to which (a process
identifier for PRIO_PROCESS, process group identifier for PRIO_PGRP, and a user ID for PRIO_USER). A zero value of who denotes the current
process, process group, or user. prio is a value in the range -20 to 20. The default priority is 0; lower priorities cause more favorable
scheduling.
The getpriority() call returns the highest priority (lowest numerical value) enjoyed by any of the specified processes. The setpriority()
call sets the priorities of all of the specified processes to the specified value. Only the super-user may lower priorities.
Additionally, the current thread or process can be placed in a background state by specifying PRIO_DARWIN_THREAD or PRIO_DARWIN_PROCESS for
which. Only a value of zero (the current thread or process) is supported for who when setting or getting background state. prio is either 0
(to remove current thread from background status) or PRIO_DARWIN_BG (to set current thread into background state). When a thread or process
is in a background state the scheduling priority is set to the lowest value, disk IO is throttled (with behavior similar to using
setiopolicy_np(3) to set a throttleable policy), and network IO is throttled for any sockets opened after going into background state. Any
previously opened sockets are not affected. The getpriority() call returns 0 when current thread or process is not in background state or 1
when the current thread is in background state. Any thread or process can set itself into background state.
RETURN VALUES
Since getpriority() can legitimately return the value -1, it is necessary to clear the external variable errno prior to the call, then check
it afterward to determine if a -1 is an error or a legitimate value. The setpriority() call returns 0 if there is no error, or -1 if there
is.
ERRORS
Getpriority() and setpriority() will fail if:
[EINVAL] Which is not one of PRIO_PROCESS, PRIO_PGRP, PRIO_USER, PRIO_DARWIN_THREAD, or PRIO_DARWIN_PROCESS.
[EINVAL] Who is not a valid process, process group, or user ID.
[EINVAL] Who is not 0 when which is PRIO_DARWIN_THREAD or PRIO_DARWIN_PROCESS.
[ESRCH] No process can be located using the which and who values specified.
In addition to the errors indicated above, setpriority() will fail if:
[EACCES] A non super-user attempts to lower a process priority.
[EPERM] A process is located, but neither its effective nor real user ID matches the effective user ID of the caller.
LEGACY SYNOPSIS
#include <sys/types.h>
#include <sys/resource.h>
The include file <sys/types.h> is necessary.
int
getpriority(int which, int who);
int
setpriority(int which, int who, int value);
The type of who has changed.
SEE ALSO
nice(1), fork(2), setiopolicy_np(3), compat(5), renice(8)
HISTORY
The getpriority() function call appeared in 4.2BSD.
4th Berkeley Distribution June 4, 1993 4th Berkeley Distribution