Date: Sat, 1 Oct 2016 20:02:09 +0200 From: Willem Jan Withagen <wjw@digiware.nl> To: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Kqueue and threading Message-ID: <111e0c35-7a4b-b6c7-ef1d-1a0d85112e61@digiware.nl>
next in thread | raw e-mail | index | archive | help
Hi, Ceph uses a lot of threading, and for any part of it communication it uses epoll(), which FreeBSD does not use. For that there was already a EvenKqueue implementation. But I think I'm now running into: The kqueue() system call creates a new kernel event queue and returns a descriptor. The queue is not inherited by a child created with fork(2). However, if rfork(2) is called without the RFFDG flag, then the descriptor table is shared, which will allow sharing of the kqueue between two processes. Kqueue descriptors are created and events are added, but then the process starts other threads and expects the kqueue-id to be valid there. However adding more events returns an error, also waiting on the ID for events to happen returns an error (descriptor invalid) Threading is done with 2 different constructions: std::thread and creating Workers Would any of these qualify with the quoted warning? and invalidate the descriptor table? If not, how can I (easily) debug the reason why my descriptors go invalid? thanx, --WjW
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?111e0c35-7a4b-b6c7-ef1d-1a0d85112e61>