sigsuspend() hang-up

by Shankar Ganesh » Tue, 10 Nov 2009 14:18:50 GMT

Sponsored Links
 Hi Friends,

I am adding H/W video codec support  to opencore and the implementation
pseudocode is as follows :

1.  setup signal handler for SIGIO
2.  Send encoded data to h/w decoder
3.  call sigsuspend() , after masing (sigprocmask)  all other signals except
4.  driver will send SIGIO once end of decoding by h/w.
5.  User space process will wake-up and process decoded data  .

Here, SIGIO is received by signal handler, but my user-space process (open
core decoder node process) is hanged and never wakes-up and hence blocked
within sigsuspend() .
Can anyone throw some ideas if you have faced similar problem ?

PS : I couldn't find any problem with signal handling mechanism as i test on
my host pc, with similar implementation.



sigsuspend() hang-up

by fadden » Wed, 11 Nov 2009 04:27:20 GMT


I don't quite understand -- you say the process receives the SIGIO,
but it's hung and never wakes up.  If the process is hung, how do you
know it received the signal?

Are you sure the signal is being delivered to the correct thread
within the process?

FWIW, the VM uses sigwait() to do something similar.


Sponsored Links

sigsuspend() hang-up

by David Turner » Wed, 11 Nov 2009 08:40:17 GMT

 Probably because Linux essentially delivers signals to random threads. So
the signal handler is called but not in the thread that is doing the
You probably need to mask SIGIO in all other threads of your process, which

A better alternative is to try something different. For example, create a
pipe() and have the signal handler send a single byte through write()
into it. Your other thread can be blocked on read()-ing the byte, and this
would work independently of the thread receiving the signal.
Be sure to catch for EINTR during the write() and read() calls though :-)

> website: 

sigsuspend() hang-up

by Shankar Ganesh » Wed, 11 Nov 2009 11:43:34 GMT


Thanks for your help.  Here signal handler (registered for SIGIO) is called
, when SIGIO is raised, but the thread waiting on sigsuspend() never
comes-out ( Here sigsuspend should have returned).

> website: 

sigsuspend() hang-up

by Shankar Ganesh » Wed, 11 Nov 2009 11:45:35 GMT


Great.  I will try using PIPE , instead of sigsuspend() .


>> website: 

Other Threads

1. Displaying google maps on android browser


Our mobile website uses google (web) maps so that users can drag and
click on.  As I don't have an HTC device around, I tried loading it on
the android emulator browser. I noticed however, that when you tap or
drag over the map, the browser does not send the events to the map,
instead it just scrolls the page.

Does this thing also happen to real devices? I 've checked that

Any help would be appreciated. Thanks


2. Share your experiences on Android 1.5 at May 26 SV Android Developers Meetup

If you live in silicon valley and had started working on Android 1.5
recently, I welcome you to join our Silicon Valley Android Developers
Meetup (  SV Android Developers Meetup is
a place for Android fans to exchange ideas and experiences with real
local people.

Our next event is at May 26 (
10252588/). In this meetup, we will invite few people who has
experiences on 1.5 to share with their knowledge

May Agenda:
6:30: Food and networking (Thanks Zanox for sponsoring the food)
7PM:  Event start
       Presentations & Demos
              James Steele
      Pitch your Android application of business idea. Let audience to
give feedback. Contact me if you wish to participate.
      Announcements: your chance to announce your news related to
      Table Topics: What to expect at Google IO. Lets collaborate some
effort during and after the event.

Also, our group's Twitter is up: You can
use twitter to send question to the speakers or presenters, or your

If you are interested in speaking, pls send your intro and PPT
abstract to me.

-David Cao


3. Simple RPC Solution

4. importing and using google maps packages

5. MapView in a Tab

6. branchs in android

7. Help with changing content with tab contents