Sponsored Content
Top Forums UNIX for Advanced & Expert Users Process on CPU inside syscall Post 302696869 by Corona688 on Wednesday 5th of September 2012 02:37:06 PM
Old 09-05-2012
Quote:
Originally Posted by jim mcnamara
1. In a word, no.
Consider write which invokes kernel mode code through a syscall. It can block sometimes, but most of the time it succeeds (or fails) right away.
'right away' isn't the same as 'instantly'. There will still be a brief interval where the kernel is running and the process is not.

If they're just waiting on the kernel to finish and not waiting for data, I suppose they'd simply be sleeping, rather than blocked, but this is beginning to split hairs. Either way it has to wait.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

process -> 1 cpu

Is there a way I can assign processes to different processors? I know in windows xp you can set process affinity, and wondered if there is a *nix equivelant. (2 Replies)
Discussion started by: Solitare
2 Replies

2. UNIX for Dummies Questions & Answers

process not using enough cpu

I am running solaris 9 on a SUn 480r. It is running SAS statistical software, these processes in full flow normally run at about 50-60% cpu (theres nothing else really running on the box) this is fine, and the SAS jobs get run nice and quick. However over the last few weeks everytime a SAS job is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

3. Solaris

How to find which process is using up too much CPU

Hi, I need to find which processes are hogging the cpu up. please advise. Thanks (1 Reply)
Discussion started by: 0ktalmagik
1 Replies

4. AIX

CPU usage of a process

I'm trying to monitor the CPU usage of a process and output that value to a file or variable. I know topas or nmon can tell me this in interactive mode but what I need is topas-looking output that allows me to write to a file after a discrete interval. Unlike nmon data collection to a file on top... (5 Replies)
Discussion started by: robot23
5 Replies

5. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

6. UNIX for Dummies Questions & Answers

100% cpu process

hi guys you know we got an issue and my support line is linux I need to make sure my linux is OK...now the issue I have this process db2sysc reaching 10% CPU utilization yeah that's a DB2 process my DB guys wants to make sure linux is not the culprit but I have no idea the situation is... (3 Replies)
Discussion started by: karlochacon
3 Replies

7. Red Hat

Process by CPU

Hello All, I am preparing a script to capture the processes consuming more CPU. So is there any way that i can sort & redirect to file only those processes consuming more than 5.0 % using ps command itself. Regards Ankit (3 Replies)
Discussion started by: ajaincv
3 Replies

8. Emergency UNIX and Linux Support

CPU and memory utilization of a process, by process name

Can someone please help me with a script that will help in identifying the CPU & memory usage by a process name, rather than a process id.This is to primarily analyze the consumption of resources, for performance tweaking. G (4 Replies)
Discussion started by: ggayathri
4 Replies

9. Shell Programming and Scripting

If a process cpu % is higer than

Is this possible as part of a bigger script to do? eg: elif myprocess.bin cpu% > 12 exit 1 elif is there a command for this? thanks (9 Replies)
Discussion started by: bilboNIX
9 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 02:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy