Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Sep 2011 08:25:54 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Jilles Tjoelker <jilles@stack.nl>, Richard Yao <ryao@cs.stonybrook.edu>
Subject:   Re: Mixing Asynchronous Network I/O and POSIX Threads
Message-ID:  <201109190825.54074.jhb@freebsd.org>
In-Reply-To: <CABDyM6Rne4pegCdRJmfG1C-khd1G8f_s7B%2BCcn_2v=NAKwrZcQ@mail.gmail.com>
References:  <CABDyM6Se4iGozRUvKjSKiV1CW%2B91Y_p7ZQ6syzP0hkaXRqe3og@mail.gmail.com> <a3dc9529a62347e5850a5ff925c9da91@HUBCAS2.cs.stonybrook.edu> <CABDyM6Rne4pegCdRJmfG1C-khd1G8f_s7B%2BCcn_2v=NAKwrZcQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, September 18, 2011 5:45:26 pm Richard Yao wrote:
> Dear Jilles,
> 
> I am using sigwaitinfo() with all interrupts masked to avoid the
> possibility of race conditions in signal handlers, but I have not used
> any realtime signals. Linux 2.6.35 found a way to invoke the SIGIO
> handler despite it being masked, but that issue would not occur under
> production conditions and that is a bug for a different mailing list.
> 
> Being unable to F_SETOWN individual threads would cause problems
> because it causes network traffic to become serialized. My code must
> run on Linux, but if I were to write FreeBSD-specific code so it would
> also work on FreeBSD, would using kqueue enable me to specify which
> threads handle events on specific file descriptors?

Yes in that you could give each thread its own kqueue fd and register other
fd's on the desired thread's kqueue.  However, Adrian's point about using
libevent is probably worth investigating to see if it will let you achieve
that in a portable way.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109190825.54074.jhb>