Sponsored Content
Top Forums Programming pthread_mutex_timedlock and Timers option Post 302457212 by ramestica on Monday 27th of September 2010 02:30:52 PM
Old 09-27-2010
pthread_mutex_timedlock and Timers option

in its man-page pthread_mutex_timedlock documents that the absolute timeout parameter should be based on the CLOCK_REALTIME clock or in the system clock. All this depending on whether the 'Timers option' is supported or not.

What do they mean by 'Timers option'? How could I tell for sure what time getter API should I use in my specific platform?

thanks,
Rodrigo
 

10 More Discussions You Might Find Interesting

1. Programming

unix and timers

Hello there.. I need to know when i start indipendant timers how can i recognize which of the active timers have made timeout alarm. The number of started timers depends on the running app I'd appreciate your help Thanks in advance (0 Replies)
Discussion started by: nightcat
0 Replies

2. UNIX for Advanced & Expert Users

-h option

Hi what does the following mean in shell scripts (-h option) val contains a string. while (-h "$val") (1 Reply)
Discussion started by: Raom
1 Replies

3. UNIX for Advanced & Expert Users

su option

We have started to us the su option on our production server. We log in with our own id and then su into a special id to perform various tasks. This allows our actions to be monitored. I need to know how to use the su option when doing an ftp between two servers. I noticed that when I log into... (1 Reply)
Discussion started by: lesstjm
1 Replies

4. Programming

cc option

my yacc output file y.tab.c is not compiling using cc y.tab.c -ly command .possibily option flag -ly is not correct.i m using red hat linux 9.please give solutions. (4 Replies)
Discussion started by: kuldeep_bora
4 Replies

5. Shell Programming and Scripting

option followed by : taking next option if argument missing with getopts

Hi all, I am parsing command line options using getopts. The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument. Below is the script: while getopts :hd:t:s:l:p:f: opt do case "$opt" in -h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies

6. Programming

Doubts about timers in linux kernel

Hi , I am trying to learn timers in linux kernel. I am trying to write a program where I can configure a timer to tick in every 5 seconds and a function should thus exicute in every five seconds. I tried one program with the help of linux/timer.h headerfile but I couldnt get the... (4 Replies)
Discussion started by: iamjayanth
4 Replies

7. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

8. Shell Programming and Scripting

A Question Regarding Timers and Output

Hi there. I am fairly new to scripting in BASH so please forgive my clumsy syntax and analogy as I try to explain what I am trying to accomplish. I have a list of mundane functions that I currently call from a script file. What I wish to do is to accurately record into a log file the times that... (17 Replies)
Discussion started by: Tenuous
17 Replies

9. Shell Programming and Scripting

-f option and -rf in rm

Hi, I'm new to shell scripting and I'm trying to read some code I need to use. Could you help me out on what it's doing? I read this as.... if the directory has files then rm all the files in that directory. I'm not sure.... if ; then run "rm -rf ${TSP_FILEPATH_PLUGIN_DIR}"; fi run... (8 Replies)
Discussion started by: jdilts
8 Replies

10. Solaris

Unrecognized option: sparc-sun-Solaris2.10/bin/as: unrecognized option `-m32'

Hi, I installed some packages required by an app built with python. But when I try python setup.py install, I get the following error: /opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-solaris2.10/bin/as: unrecognized option `-m32' Could anyone tell me what's wrong... (4 Replies)
Discussion started by: Kimkun
4 Replies
PTHREAD_RWLOCK_TIMEDRDLOCK(P)				     POSIX Programmer's Manual				     PTHREAD_RWLOCK_TIMEDRDLOCK(P)

NAME
pthread_rwlock_timedrdlock - lock a read-write lock for reading SYNOPSIS
#include <pthread.h> #include <time.h> int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rwlock, const struct timespec *restrict abs_timeout); DESCRIPTION
The pthread_rwlock_timedrdlock() function shall apply a read lock to the read-write lock referenced by rwlock as in the pthread_rwlock_rdlock() function. However, if the lock cannot be acquired without waiting for other threads to unlock the lock, this wait shall be terminated when the specified timeout expires. The timeout shall expire when the absolute time specified by abs_timeout passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abs_timeout), or if the abso- lute time specified by abs_timeout has already been passed at the time of the call. If the Timers option is supported, the timeout shall be based on the CLOCK_REALTIME clock. If the Timers option is not supported, the timeout shall be based on the system clock as returned by the time() function. The resolution of the timeout shall be the resolution of the clock on which it is based. The timespec data type is defined in the <time.h> header. Under no circumstances shall the function fail with a timeout if the lock can be acquired immediately. The validity of the abs_timeout parameter need not be checked if the lock can be immedi- ately acquired. If a signal that causes a signal handler to be executed is delivered to a thread blocked on a read-write lock via a call to pthread_rwlock_timedrdlock(), upon return from the signal handler the thread shall resume waiting for the lock as if it was not inter- rupted. The calling thread may deadlock if at the time the call is made it holds a write lock on rwlock. The results are undefined if this function is called with an uninitialized read-write lock. RETURN VALUE
The pthread_rwlock_timedrdlock() function shall return zero if the lock for reading on the read-write lock object referenced by rwlock is acquired. Otherwise, an error number shall be returned to indicate the error. ERRORS
The pthread_rwlock_timedrdlock() function shall fail if: ETIMEDOUT The lock could not be acquired before the specified timeout expired. The pthread_rwlock_timedrdlock() function may fail if: EAGAIN The read lock could not be acquired because the maximum number of read locks for lock would be exceeded. EDEADLK The calling thread already holds a write lock on rwlock. EINVAL The value specified by rwlock does not refer to an initialized read-write lock object, or the abs_timeout nanosecond value is less than zero or greater than or equal to 1000 million. This function shall not return an error code of [EINTR]. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
Applications using this function may be subject to priority inversion, as discussed in the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. The pthread_rwlock_timedrdlock() function is part of the Threads and Timeouts options and need not be provided on all implementations. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
pthread_rwlock_destroy() , pthread_rwlock_rdlock() , pthread_rwlock_timedwrlock() , pthread_rwlock_tryrdlock() , pthread_rwlock_trywrlock() , pthread_rwlock_unlock() , pthread_rwlock_wrlock() , the Base Definitions volume of IEEE Std 1003.1-2001, <pthread.h>, <time.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 PTHREAD_RWLOCK_TIMEDRDLOCK(P)
All times are GMT -4. The time now is 02:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy