lkml.org 
[lkml]   [1999]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Signal driven IO



Ok, I figured it out. Kernel 2.3.x handles it correctly. I was hoping that I
could make this work on 2.2.x by using sigwait()+poll() to fill in the si_band
info when needed. The F_SETSIG setting doesn't seem to propagate to the worker
thread under 2.2.x -- are there any plans to fix/back port this?



On Mon, 15 Nov 1999, Don Howard wrote:
>
>
> Here's a question about the sigwaitinfo-based IO mechanisim.
>
> I've got a mutli-threaded app where one thread handles accept()ing new
> connections and then distributes those connections to a pool of
> workers. The accept() thread sets up async io on the socket and
> assigns that socket to one of the woker threads via F_SETOWN
>
> When I execute the program, I see SIGIO being delivered to the worker
> thread, rather than the RT signal that I requested.
>
> Is this a bug with my code, the kernel, or is it a just a feature
> that I didn't expect?
>
>
>
> [Accept thread]
> fcntl (newsock, F_SETOWN, SOME_WORKER_PID); // Assign the new
> // connetion to a worker.
>
> fcntl (newsock, F_SETSIG, SOME_RT_SIG);
>
> fcntl (newsock, F_SETFL, fcntl(F_GETFL) | O_NONBLOCK | O_ASYNC);
>
>
>
> [Worker thread]
> sigblock (SOME_RT_SIG);
>
> while (1)
> {
> sigwaitinf ()
> .
> .
> .
> // do interesting things
> }
>
>
>
>

--
Don Howard
dhoward@multitude.com



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.399 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site