Sponsored Content
Top Forums Shell Programming and Scripting How to wakeup sleeping processes Post 302093709 by stevefox on Monday 23rd of October 2006 02:02:34 AM
Old 10-23-2006
How to wakeup sleeping processes

Hi,
Could someone please tell me how to wakeup sleeping processes? (i.e. change the process status from "S" to "R" when viewing in ps command).

I ran a few programs in the background by "&" which went into "sleep" mode and I want them to run.

Any help will be greatly appreciated.

Steve
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl: sleeping during a command

hello everyone, i am attempting to run the sleep function (i've also tried select) during the execution of a command to mimic a status. for example: # this is a terminal screen # here the process is executed # below this a status is displayed while the command executes like so:... (3 Replies)
Discussion started by: effigy
3 Replies

2. Shell Programming and Scripting

Unable to kill sleeping process

Hi, I'm trying to delete a sleeping process (parent ID is not 1) with "kill -9" command by the owner of the process (infodba) but it doesn't get killed. Is there any way of killing this process without killing the parent process or rebooting? (I'm using HP Unix B.11.11) $ ps -eflx | grep... (0 Replies)
Discussion started by: stevefox
0 Replies

3. UNIX for Advanced & Expert Users

Monitoring Processes - Killing hung processes

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

4. Solaris

Identifying and grouping OS processes and APP processes

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. Shell Programming and Scripting

Help on sleeping the script

Hi all, How can i specify to sleep for 24 hours in a script Thanks Firestar (5 Replies)
Discussion started by: firestar
5 Replies

6. Shell Programming and Scripting

Sleep process not sleeping!

I had a script executing every hour to kill a process. I used loop rather than cron to execute it periodically. But now when I am trying to kill that sleep process of 1 hour its not getting killed. it is taking a new PID everytime I kill. To disable the script commenting is the only option... (1 Reply)
Discussion started by: nixhead
1 Replies

7. UNIX for Dummies Questions & Answers

Sleep command not sleeping for specified time.

Hi, I have ascript with a recursive funtion below. I have mentioned to sleep for 60minutes but it doesnt doing so. Its keep on running until if /elif conditions satiesfies. Can you pls help what is wrong here. funcstatus () { if then echo "`date` - Current status... (2 Replies)
Discussion started by: gaddamja
2 Replies

8. UNIX for Dummies Questions & Answers

GNU Linux sleeping processes in top command

hi all sleeping processes in the following output , are they doing anything , but consuming lot of sources, should I need to kill them , how to know , , what they are doing and the output says out of 260 processes only 9 are running , and 251 are sleeping , what does the sleeping means, can... (8 Replies)
Discussion started by: sidharthmellam
8 Replies

9. Shell Programming and Scripting

Signal trapped during read resumes sleeping

Greetings. This is my first post in this forum; I hope y'all find it useful. One caveat: "Concise" is my middle name. NOT! :D I am almost done with a shell script that runs as a daemon. It monitors a message log that is frequently written to by a database server but it it works my client will... (2 Replies)
Discussion started by: jakesalomon
2 Replies
LTSLEEP(9)						   BSD Kernel Developer's Manual						LTSLEEP(9)

NAME
ltsleep, tsleep, wakeup -- process context sleep and wakeup SYNOPSIS
#include <sys/proc.h> int tsleep(wchan_t ident, pri_t priority, const char *wmesg, int timo); void wakeup(wchan_t ident); DESCRIPTION
The interfaces described in this manual page are obsolete and will be removed from a future version of the system. The ltsleep() interface has been obsoleted and removed from the system. Please see the condvar(9), mutex(9), and rwlock(9) manual pages for information on kernel synchronisation primitives. These functions implement voluntary context switching. tsleep() is used throughout the kernel whenever processing in the current context can not continue for any of the following reasons: o The current process needs to await the results of a pending I/O operation. o The current process needs resources (e.g., memory) which are temporarily unavailable. o The current process wants access to data-structures which are locked by other processes. The function wakeup() is used to notify sleeping processes of possible changes to the condition that caused them to go to sleep. Typically, an awakened process will -- after it has acquired a context again -- retry the action that blocked its operation to see if the ``blocking'' condition has cleared. The tsleep() function takes the following arguments: ident An identifier of the ``wait channel'' representing the resource for which the current process needs to wait. This typically is the virtual address of some kernel data-structure related to the resource for which the process is contending. The same identifier must be used in a call to wakeup() to get the process going again. ident should not be NULL. priority The process priority to be used when the process is awakened and put on the queue of runnable processes. This mechanism is used to optimize ``throughput'' of processes executing in kernel mode. If the flag PCATCH is OR'ed into priority the process checks for posted signals before and after sleeping. wmesg A pointer to a character string indicating the reason a process is sleeping. The kernel does not use the string, but makes it available (through the process structure field p_wmesg) for user level utilities such as ps(1). timo If non-zero, the process will sleep for at most timo/hz seconds. If this amount of time elapses and no wakeup(ident) has occurred, and no signal (if PCATCH was set) was posted, tsleep() will return EWOULDBLOCK. The wakeup() function will mark all processes which are currently sleeping on the identifier ident as runnable. Eventually, each of the pro- cesses will resume execution in the kernel context, causing a return from tsleep(). Note that processes returning from sleep should always re-evaluate the conditions that blocked them, since a call to wakeup() merely signals a possible change to the blocking conditions. For example, when two or more processes are waiting for an exclusive-access lock (see lock(9)), only one of them will succeed in acquiring the lock when it is released. All others will have to go back to sleep and wait for the next opportunity. RETURN VALUES
tsleep() returns 0 if it returns as a result of a wakeup(). If a tsleep() returns as a result of a signal, the return value is ERESTART if the signal has the SA_RESTART property (see sigaction(2)), and EINTR otherwise. If tsleep() returns because of a timeout it returns EWOULDBLOCK. SEE ALSO
sigaction(2), condvar(9), hz(9), lock(9), mutex(9), rwlock(9) HISTORY
The sleep/wakeup process synchronization mechanism is very old. It appeared in a very early version of Unix. tsleep() appeared in 4.4BSD. ltsleep() appeared in NetBSD 1.5. BSD
January 28, 2012 BSD
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy