Sponsored Content
Top Forums Programming Periodic thread with clock_nanosleep Post 302741383 by laro1983 on Saturday 8th of December 2012 10:52:34 AM
Old 12-08-2012
More information

Hi
Thanks for your answer.
- I'm using red-hat.
- the thread which is periodic has the highest priority among all the other threads.
- when the thread wake up, I check the last parameter (remain parameter) to see if the thread was interrupt, but it hasn't.

so what could be the reason that the delta (which I check with the clock_gettime function) is less than the amount of time is need to be ?
(if I look at clock_nanosleep it seem the delta is OK, but not if we look at the delta from clock_gettime)
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

create a periodic execution of a script?

Hello every body goal: create a script that control periodicly ( every 30 min ) if a process is already actif. How can I do that? thanks (3 Replies)
Discussion started by: hoang
3 Replies

2. Shell Programming and Scripting

Tcsh periodic requires carriage return

Hello All, My first post on this forum. I am using cygwin to help me with some routine jobs on my laptop, with tcsh as my shell. I need to copy a set of files from one directory to a network drive every minute. So I have set tperiod = 1 alias periodic 'cp *.txt /cygdrive/z/Data' ... (0 Replies)
Discussion started by: OmniVision
0 Replies

3. Cybersecurity

Periodic check of user password strength

I need to periodically run a check on the passwords of the users (Redhat 5.0) to verify that all passwords meet minimal standards. I remember seeing a script years ago that grabbed the encrypted passwords from the file and checked if they matched any of the encrypted strings in another file, plus... (1 Reply)
Discussion started by: tlynnch
1 Replies

4. UNIX for Dummies Questions & Answers

Remove 1st character in periodic lines

Hi, I have a file that looks like this, the unity of information is composed of four lines, and these extends for millions. My objective is to remove the highligthed "T". How to attack this? This character is always constant in type "T" and position "1st" but the rest of the line is... (7 Replies)
Discussion started by: sargotrons
7 Replies

5. Ubuntu

Wireless periodic drops - Ubuntu 12.10

Ubuntu wireless has been fine until fresh installation of 12.10. Now, I have periodic drops of the wireless. I can manually disconnect and then reconnect to get the service back. Sometimes, I am unable to disconnect. When this happens, I have to log off and then on again. (0 Replies)
Discussion started by: jamarsh
0 Replies

6. Shell Programming and Scripting

awk Script: removing periodic boundaries

SOLVED, thank you! Edit2: Good news everyone, I managed to get it down to a "simple" problem, but I still have some syntax issues. Here is the code which troubles me: awk 'BEGIN{x2=0;x1=0;crit=0;} $1 < 1000000 {x2=$4; diffx=x2-x1; x1=x2; diffx > 3.6 ? {crit=1} : {crit=0};... (2 Replies)
Discussion started by: Consti
2 Replies

7. What is on Your Mind?

Vuejs Periodic Table by Kadin Zhang

Was working on Vue.js and stumbled upon this beautiful Vue project by Kadin Zhang Periodicity is a dynamic periodic table built with Vue.js that animates and graphs data to aid the visualization of chemical concepts. The code is available on GitHub (2 Replies)
Discussion started by: Neo
2 Replies
ATOMIC_ADD(3)						   BSD Library Functions Manual 					     ATOMIC_ADD(3)

NAME
atomic_add, atomic_add_32, atomic_add_int, atomic_add_long, atomic_add_ptr, atomic_add_64, atomic_add_32_nv, atomic_add_int_nv, atomic_add_long_nv, atomic_add_ptr_nv, atomic_add_64_nv -- atomic add operations SYNOPSIS
#include <sys/atomic.h> void atomic_add_32(volatile uint32_t *ptr, int32_t delta); void atomic_add_int(volatile unsigned int *ptr, int delta); void atomic_add_long(volatile unsigned long *ptr, long delta); void atomic_add_ptr(volatile void *ptr, ssize_t delta); void atomic_add_64(volatile uint64_t *ptr, int64_t delta); uint32_t atomic_add_32_nv(volatile uint32_t *ptr, int32_t delta); unsigned int atomic_add_int_nv(volatile unsigned int *ptr, int delta); unsigned long atomic_add_long_nv(volatile unsigned long *ptr, long delta); void * atomic_add_ptr_nv(volatile void *ptr, ssize_t delta); uint64_t atomic_add_64_nv(volatile uint64_t *ptr, int64_t delta); DESCRIPTION
The atomic_add family of functions add a signed value delta to the variable referenced by ptr in an atomic fashion. The *_nv() variants of these functions return the new value. The 64-bit variants of these functions are available only on platforms that can support atomic 64-bit memory access. Applications can check for the availability of 64-bit atomic memory operations by testing if the pre-processor macro __HAVE_ATOMIC64_OPS is defined. SEE ALSO
atomic_ops(3) HISTORY
The atomic_add functions first appeared in NetBSD 5.0. BSD
April 11, 2007 BSD
All times are GMT -4. The time now is 07:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy