Date: Fri, 15 Jun 2001 20:20:03 -0700 (PDT) From: Brian Mitchell <bem@atlanta-bsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/28112: Packet capture does not work well with -pthead option. Message-ID: <200106160320.f5G3K3j01249@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/28112; it has been noted by GNATS. From: Brian Mitchell <bem@atlanta-bsd.org> To: freebsd-gnats-submit@FreeBSD.org, jl@ntt-20.ecl.net?sub Cc: Subject: Re: kern/28112: Packet capture does not work well with -pthead option. Date: Fri, 15 Jun 2001 23:12:02 -0400 The problem is due to how pcap works. It is largely blocking based, and will return packets as it gets them. PCAP was never intended to be multithreaded, and the read of the bpf device will call sys_read() rather than the libc_r wrapper for read, so your other threads will never be scheduled. If you only want to read packets in 1 thread, and do other things in the other threads, compiling pcap with -pthread _may_ be acceptable, but I have not looked at the code recently. As I recall, there was atleast _some_ static data, but as long as all the pcap calls take place in a single thread, you should be ok. YMMV. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106160320.f5G3K3j01249>