LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2006, 12:19 AM   #1
miles_christian
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
real-time signals cause program termination


Hi, i'm using posix real-time signals for notification of socket events, and sigwaitinfo to get the events. My problem is whenever I receive a real-time signal my app terminates. If I set a signal handler function for the real-time signal, the application does not terminate. But I want to use sigwaitinfo() to get the signal and not a signal handler func.

I understand that an unhandled RT signal causes program termination, so I block the signal using pthread_sigmask()(since i'm running multithreaded) but i'm still getting the signals.

i'm using red hat enterprise 3, can anyone explain why I can't seem to block the RT signals...

Many Thanks!

Last edited by miles_christian; 08-16-2006 at 12:37 AM.
 
Old 08-17-2006, 12:51 AM   #2
mhcox
Member
 
Registered: Aug 2005
Location: Albuquerque, NM
Distribution: Fedora
Posts: 30

Rep: Reputation: 15
Quote:
Originally Posted by miles_christian
Hi, i'm using posix real-time signals for notification of socket events, and sigwaitinfo to get the events. My problem is whenever I receive a real-time signal my app terminates. If I set a signal handler function for the real-time signal, the application does not terminate. But I want to use sigwaitinfo() to get the signal and not a signal handler func.

I understand that an unhandled RT signal causes program termination, so I block the signal using pthread_sigmask()(since i'm running multithreaded) but i'm still getting the signals.

i'm using red hat enterprise 3, can anyone explain why I can't seem to block the RT signals...

Many Thanks!
Since pthread_sigmask() only affects the signal mask of the calling thread, perhaps you have another thread that's running at the time the RT signal arrives that hasn't called pthread_sigmask() appropriately?
 
Old 08-21-2006, 10:59 PM   #3
miles_christian
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Original Poster
Rep: Reputation: 0
thanks mhcox, yup that was my problem, another thread was running an I did not block the signals on that thread. Fixed it now, thanks again !!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Real Time Signals getting EPERM warrenpatrick Programming 4 08-25-2006 09:29 AM
Question about abnormal program termination ghoughto Programming 5 06-15-2005 07:04 AM
Software to time termination hongman Linux - Software 6 04-03-2005 07:37 AM
shell script - trap program termination dnijaguar Linux - Software 0 07-19-2003 12:27 AM
Random program termination - odd jamespetts Linux - General 4 11-01-2002 04:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration