Sponsored Content
Top Forums Programming using signals instead of busy wait Post 302146448 by jim mcnamara on Tuesday 20th of November 2007 02:33:31 PM
Old 11-20-2007
The alarm() api sets a timer and when the timer expires delivers SIGALRM to the calling process. Meanwhile the process is suspended.
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

CD Drive is busy

one problem which seems simple but i've faced many times is when i've used cd & want to eject, however i'm not in /dev/cdrom/... in any of my Xterms but it gives the message that the the CD drive is busy. the only thing i could do is /etc/init.d/volmgt stop & eject the CD manually but it doesn't... (6 Replies)
Discussion started by: nikk
6 Replies

2. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies

3. Shell Programming and Scripting

wait command - cat it wait for not-chile process?

Did not use 'wait' yet. How I understand by now the wait works only for child processes, started background. Is there any other way to watch completion of any, not related process (at least, a process, owned by the same user?) I need to start a background process, witch will be waiting... (2 Replies)
Discussion started by: alex_5161
2 Replies

4. UNIX for Advanced & Expert Users

Filesystem mystery: disks are not busy on one machine, very busy on a similar box

Hi, We have a filesystem mystery on our hands. Given: 2 machines, A and Aa. Machine Aa is the problem machine. Machine A is running Ubuntu, kernel 2.6.22.9 #1 SMP Wed Feb 20 08:46:16 CST 2008 x86_64 GNU/Linux. Machine Aa is running RHEL5.3, kernel 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38... (2 Replies)
Discussion started by: mschwage
2 Replies

5. Shell Programming and Scripting

calling a shell script in background and wait using "wait" in while loop

Hi, I am facing a strange issue, when i call a script from my while loop in background it doesnt go in background, despite the wait i put below the whil loop it goes forward even before the process put in background is completed. cat abc.txt | while read -u4 line do #if line contains #... (2 Replies)
Discussion started by: mihirvora16
2 Replies
mktimer(3)						     Library Functions Manual							mktimer(3)

NAME
mktimer - Allocates a per-process timer LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <sys/timers.h> timer_t mktimer( int clock_type, int notify_type, void *reserved) ; PARAMETERS
Specifies the system-wide clock to be used as a per-process time base for the new timer. Specifies the mechanism by which a process is to be notified when the per-process timer times out. Not used. DESCRIPTION
The mktimer() function is used to allocate a per-process timer using a specified system-wide clock as its timebase. The mktimer() function returns a unique timer ID of type timer_t, which is used to identify the timer in per-process timer requests. Each implementation of per-process timers defines a set of clocks that can be used as a time base for per-process timers, and one or more mechanisms for notifying the process that a per-process timer has expired. The Tru64 UNIX operating system allows each process to allocate one per-process timer whose clock_type parameter is specified by the TIMEOFDAY symbolic constant, which is defined in the timers.h include file, using the notification mechanism whose notify_type parameter is specified by the DELIVERY_SIGNALS symbolic constant. When the notify_type parameter is specified as DELIVERY_SIGNALS, the system sends a SIGALRM signal to the process whenever the timer expires. NOTES
Per-process timers are not inherited by a child process across fork() or exec() functions. The reserved parameter is not currently used, but is specified for future support of other delivery mechanisms. The mktimer() function is part of the POSIX 1003.4 real time extensions, which is not an approved standard. As such, it is liable to change. Trial use RETURN VALUES
Upon successful completion, the mktimer() function returns a timer_t value, which may be passed to a per-process timer call. Otherwise, mktimer() returns a value of (timer_t)-1 and sets errno to indicate the error. ERRORS
If the mktimer() function fails, errno may be set to one of the following values: The calling process has already allocated all available timers. The clock_type or notify_type parameter is invalid. RELATED INFORMATION
Functions: exec(2), fork(2), getclock(3), gettimer(3), reltimer(3), rmtimer(3), setclock(3) delim off mktimer(3)
All times are GMT -4. The time now is 07:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy