Sponsored Content
Top Forums Programming How to use sigmask in order to make signals can be processed by a thread Post 302502007 by alister on Sunday 6th of March 2011 01:06:29 PM
Old 03-06-2011
Worse, you can't even count on being able to safely set the value of a variable in a signal handler unless it can be done atomically (such as with volatile sig_atomic_t). You really want to do as little as possible in a sighandler. If possible, set an atomic flag and get out.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting access_log.processed in crontab

Hi, I've worked out that my server was getting clogged with the access_log.processed file. I deleted it using the command > /var/www/vhosts/domain.com/statistics/logs/access_log.processed I also set that up as a crontab job for every Wednesday. What I was wondering is the version using... (4 Replies)
Discussion started by: chickenhouse
4 Replies

2. Shell Programming and Scripting

Awk: first line not processed correctly

Hey, I've made a little awk-script which reorders lines. Works okay, only problem is that is doesn't process the first line correctly. If I switch lines in the Input file it doesn't proces this first line either. Somebody please help! Here's is the code and the input file! thanx ... (1 Reply)
Discussion started by: BartleDuc
1 Replies

3. Programming

Question About Multi-Processed Applications... fork()

Assume we have an application built on *nix that uses fork()...then the processes procedure is going to act as follow: X is considered a parent process (first click on application) Y is considered a child process of X (second click on application) Z is considered a child process of Y (third... (6 Replies)
Discussion started by: f.ben.isaac
6 Replies

4. Programming

How can I make the parent thread wait

Hi All, I will be glad if you could help me resolve this problem. I have created two detachable threads and wanted to them execute independent of the parent thread ( the main task which creates the detachable threads). But I see no output coming from the execution of two detachable threads.... (4 Replies)
Discussion started by: jayfriend
4 Replies

5. Shell Programming and Scripting

Deleting processed lines

I have a log file that I am processing. This contains messages from and to a server (requests and responses). The responses to requests may not be in order i.e. we can have a response to a request after several requests are sent, and in some error cases there may not be any response message. ... (2 Replies)
Discussion started by: BootComp
2 Replies

6. Shell Programming and Scripting

remember processed files

Hello dear community! I have the following task to accomplish: there is a directory with approximately 2 thousand files. I have to write a script which would randomly extract 200 files on the first run. On the second run it should extract again 200 files but that files mustn't intersect with... (5 Replies)
Discussion started by: sidorenko
5 Replies

7. Shell Programming and Scripting

Downloading processed HTML of PHP page

Hi, I am trying to obtain the HTML code of a PHP page (http:// areferee .com/soccer/test1.php?quiz=50&ran=1&t=5) after the page has been processed; I want pure HTML. Is there a Unix command I can use to do this? I have tried wget, GET, curl but I am getting odd behaviour i.e. it is not... (9 Replies)
Discussion started by: djcas
9 Replies

8. Shell Programming and Scripting

Running sed and counting number of lines processed

/bin/sed -n ';4757335,$ p' | wc -l /bin/sed -n ';4757335,$ p' | egrep "Failed" | egrep -c "PM late arrrival" how can i combine the above two sed commands into one? i want to count the number of lines between the specified line number and the end of the file. AND and i want to count how many... (5 Replies)
Discussion started by: SkySmart
5 Replies

9. UNIX for Advanced & Expert Users

Problem With UTF8 Byte Order Make

Hi Im migrating a few websites from my old webserver (CentOS-5) to a new server (CentOS6) , one of these websites is multilingual and has a lot of utf8 files(html,php) with different languages (i.e arabic, persian, russian ,etc). In old server when i do: file mailer.php I get : ... (6 Replies)
Discussion started by: mohs3n
6 Replies

10. Shell Programming and Scripting

Check the file processed Completion

Hi, I have a wierd requirement where i need to check for a file transfered to my Server and once it is completed i need to start processing my jobs. My server is AIX 6.0 and i want to know is there some way in unix i can keep on checking the file and once it is completed successfully i can... (5 Replies)
Discussion started by: prasson_ibm
5 Replies
atomic_dec(3C)															    atomic_dec(3C)

NAME
atomic_dec, atomic_dec_8, atomic_dec_uchar, atomic_dec_16, atomic_dec_ushort, atomic_dec_32, atomic_dec_uint, atomic_dec_ulong, atomic_dec_64, atomic_dec_ptr, atomic_dec_8_nv, atomic_dec_uchar_nv, atomic_dec_16_nv, atomic_dec_ushort_nv, atomic_dec_32_nv, atomic_dec_uint_nv, atomic_dec_ulong_nv, atomic_dec_64_nv, atomic_dec_ptr_nv - atomic decrement operations SYNOPSIS
#include <atomic.h> void atomic_dec_8(volatile uint8_t *target); void atomic_dec_uchar(volatile uchar_t *target); void atomic_dec_16(volatile uint16_t *target); void atomic_dec_ushort(volatile ushort_t *target); void atomic_dec_32(volatile uint32_t *target); void atomic_dec_uint(volatile uint_t *target); void atomic_dec_ulong(volatile ulong_t *target); void atomic_dec_64(volatile uint64_t *target); void atomic_dec_ptr(volatile void *target); uint8_t atomic_dec_8_nv(volatile uint8_t *target); uchar_t atomic_dec_uchar_nv(volatile uchar_t *target); uint16_t atomic_dec_16_nv(volatile uint16_t *target); ushort_t atomic_dec_ushort_nv(volatile ushort_t *target); uint32_t atomic_dec_32_nv(volatile uint32_t *target); uint_t atomic_dec_uint_nv(volatile uint_t *target); ulong_t atomic_dec_ulong_nv(volatile ulong_t *target); uint64_t atomic_dec_64_nv(volatile uint64_t *target); void *atomic_dec_ptr_nv(volatile void *target); These functions enable the decrementing (by one) of the value stored in target to occur in an atomic manner. The *_nv() variants of these functions return the new value of target. No errors are defined. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ atomic_add(3C), atomic_and(3C), atomic_bits(3C), atomic_cas(3C), atomic_inc(3C), atomic_or(3C), atomic_swap(3C), membar_ops(3C), attributes(5), atomic_ops(9F) The *_nv() variants are substantially more expensive on some platforms than the versions that do not return values. Do not use them unless you need to know the new value atomically (for example, when decrementing a reference count and checking whether it went to zero). 13 May 2005 atomic_dec(3C)
All times are GMT -4. The time now is 01:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy