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
SIGIO.
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.

Regards,
Shankar

-- 



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
sigsuspend.
You probably need to mask SIGIO in all other threads of your process, which
sucks.

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() .

Thanks,
Shankar






>> website: 



Other Threads

1. Does NIO work on Android? (Specifically Apache HTTPCore 4.1?)

It keeps crashing on SelectorImpl.wakeup (line:418) with a Null
Pointer Exception. Even the sample code on Apache's web site crashes
like this. I tried it on a 2.2 emulator, my Galaxy Tab running 2.2,
and even a 2.0 and 2.1 emulator, targetting 2.0, 2.1, and 2.2... It
crashes the same on all cases, just at a different line number, but
same exception.

I tried this with both HttpCore 4.0 and 4.1 but the results are the
same.

wakeup it tries to write a byte to the sink, but I'm in the de{*filter*},
it says that sink and source are both null. I'm assuming it's null,
becuase when the pipe was opened, it returned null, which from other
googling, may have something to do with IPv6 support? I tried setting
the properties to use IPv4, but that did nothing. But I thought that
problem was limited to 2.2, becuase I tried it on 2.1 and 2.0, and got
the same problem...  This is very frustrating... Any help will be
greatly appreciated!

Thanks!

-- 

2. Using ContentObserver with a Cursor

I've been trying to use a content observer with an sqlite cursor, but
I have not had any luck thus far. I want to use it to be able know
when I need to requery the database rather than poll it periodically
for changes. Does anyone if this is possible?

-- 

3. problem: Keystore ruined alias lost

4. hash key for android facebook application

5. Repacking a .apk file

6. Reg:-CTS ERROR:: install met failure [install_failed_older_sdk]

7. GK: drawable-mdpi vs drawable-ldpi