09-05-2012
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.
A process consists of kernel memory and process memory. The kernel memory can access lots of really dangerous things, so access there is very restricted, through syscalls. When a syscall is active the process is still running, but it is not in user mode, it is in kernel mode instead.
These syscalls do one thing very carefully. Blocking only occurs when a resource is not available, for example no data is available on a socket, so a read (recv) call will normally block until data shows up. A read call will also block waiting for user input, like when you are working on the command line.
Most syscalls do not block, they either fail or return with success right away (assuming they can get cpu, which is not what I think we are talking about).
You can block what seems like forever waiting in a realtime system to get cpu, when your process priority is really low. But. This is true either for user mode operations or kernel mode operations. And is not particular to syscalls.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
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
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
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
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
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
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
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
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
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
LEARN ABOUT POSIX
syscall
syscall(3UCB) SunOS/BSD Compatibility Library Functions syscall(3UCB)
NAME
syscall - indirect system call
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
#include <sys/syscall.h>
int syscall(number, arg, ...);
DESCRIPTION
syscall() performs the function whose assembly language interface has the specified number, and arguments arg .... Symbolic constants for
functions can be found in the header <sys/syscall.h>.
RETURN VALUES
On error syscall() returns -1 and sets the external variable errno (see intro(2)).
FILES
<sys/syscall.h>
SEE ALSO
intro(2), pipe(2)
NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system
libraries or in multi-thread applications is unsupported.
WARNINGS
There is no way to use syscall() to call functions such as pipe(2) which return values that do not fit into one hardware register.
Since many system calls are implemented as library wrappers around traps to the kernel, these calls may not behave as documented when
called from syscall(), which bypasses these wrappers. For these reasons, using syscall() is not recommended.
SunOS 5.10 22 Jan 1993 syscall(3UCB)