473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

sigaction, muxex, condition variable

In a Posix compliant multi-threaded C++ program,
I would like to use sigaction() to catch SIGTERM,
and from my signal handler, lock a mutex, and
broadcast a condition variable. Is this ok?

Thanks,
Mike.

Aug 8 '07 #1
4 1885
Mike - EMAIL IGNORED wrote:
In a Posix compliant multi-threaded C++ program,
I would like to use sigaction() to catch SIGTERM,
and from my signal handler, lock a mutex, and
broadcast a condition variable. Is this ok?
You might be better off asking in a Posix newsgroup.
Aug 8 '07 #2
On Wed, 08 Aug 2007 18:12:07 -0400, Victor Bazarov wrote:
Mike - EMAIL IGNORED wrote:
>In a Posix compliant multi-threaded C++ program,
I would like to use sigaction() to catch SIGTERM,
and from my signal handler, lock a mutex, and
broadcast a condition variable. Is this ok?

You might be better off asking in a Posix newsgroup.
Can you suggest a newsgroup?

Aug 9 '07 #3
Mike - EMAIL IGNORED wrote:
On Wed, 08 Aug 2007 18:12:07 -0400, Victor Bazarov wrote:
>Mike - EMAIL IGNORED wrote:
>>In a Posix compliant multi-threaded C++ program,
I would like to use sigaction() to catch SIGTERM,
and from my signal handler, lock a mutex, and
broadcast a condition variable. Is this ok?

You might be better off asking in a Posix newsgroup.

Can you suggest a newsgroup?
One with "posix" in its name, perhaps? Or maybe one
dedicated to your OS...
Aug 9 '07 #4
joe
On Aug 8, 8:21 pm, Mike - EMAIL IGNORED <m_d_berger_1...@yahoo.com>
wrote:
On Wed, 08 Aug 2007 18:12:07 -0400, Victor Bazarov wrote:
Mike - EMAIL IGNORED wrote:
In a Posix compliant multi-threaded C++ program,
I would like to use sigaction() to catch SIGTERM,
and from my signal handler, lock a mutex, and
broadcast a condition variable. Is this ok?
You might be better off asking in a Posix newsgroup.

Can you suggest a newsgroup?
I would consider asking in comp.programming.threads. They deal with
threading issues in many OSs.

joe

Aug 9 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tristan | last post by:
Is there any support for a negative condition in If statements in PHP. Some tutorials ive found say that you can use the if!(condition)cmd; syntax. however i always get an error when i use that....
5
by: lucanos | last post by:
Hey Guys, Hoping that you can help me, as I have been scratching my head and getting nothing but dandruff... SITUATION --------- I have a webpage which users will be viewing, which has forms...
6
by: Shill | last post by:
I have several questions. In C, AFAIU, a for loop is just syntactic sugar for a while loop. for (i1; i2; i3) i4; is equivalent to i1 while (i2) {
3
by: Douglas | last post by:
Hi, In the loop for(i=0; i< h+1; i++); if h=10 say, then is h+1 evaluated every time or, between iterations, does the for loop remember that the condition i<11 is being applied? I'm guessing...
10
by: noleander | last post by:
I've got an application that uses Pthread to do threading. Mostly Im using Condition Variables and the associated function calls: - pthread_cond_wait() - pthread_cond_signal() -...
3
by: Yohan | last post by:
Hello, I have a question concerning the template classes and their parameters. Is it possible to set a condition on the template parameters in a way that could block the compilation if the...
1
by: hpandey | last post by:
sigaction : using "void (*sa_sigaction)(int, siginfo_t *, void *);" -------------------------------------------------------------------------------- hello, in sigaction manpage it's written :...
2
by: martin paul | last post by:
Hello Sir...Could you tell me the KEY difference between signal and sigaction functions....Kindly consider the following sample program which is using signal function... #include <signal.h> void...
9
by: Marijn | last post by:
Hey everybody, I was wondering if the following would be a valid JavaScript assignment vor a variable and if anybody knows this to work in IE6 or lower? var someVar = (typeof(someVar) ===...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.