Socket calls from timer functions (server based)

Ian Caddy ianc at goanna.iinet.net.au
Wed Apr 13 02:15:55 UTC 2005


Hi Gene,

As far as I am aware, the TSRs run in the context of the timer interrupt 
service routine, which means you can only perform operations that are 
safe in interrupts.

Network functions are generally not safe to call from interrupts, as 
most network functions are blocking functions.

You will probably need to find another way to implement this, such as 
sending an event or message to a thread that can perform the setsockopt.

I hope this helps.

regards,

Ian Caddy
Goanna Technologies Pty Ltd


Smith, Gene SEA wrote:
> If I try to make a socket call, e.g., setsockopt, from inside the server
> based timer action function it fails in _CORE_mutex_Seize apparently
> because dispatching is disabled in _Timer_Server_body (file
> timeserver.c). Is there anyway around this limitation or should I "don't
> do that"?
> 
> My timer service routine (TSR), which does socket calls, is called right
> after _Thread_Disable_dispatch() in _Timer_Server_body(). I was hoping
> my TSR could do anything a normal task could do, i.e., networking calls.
> 
> Gene
> 
> 



More information about the users mailing list