| Summary: | Packet capture does not work well with -pthead option. | ||
|---|---|---|---|
| Product: | Base System | Reporter: | jl <jl> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.3-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
jl
2001-06-13 03:00:02 UTC
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. State Changed From-To: open->closed State Changed From-To: closed->open Closed by mistake. BTW, I don't think the pcap library was intended to support threaded applications anyways...this could *probably* be closed. State Changed From-To: open->suspended Moved to suspended, based on bmah's comments. This libary isn't intended to work in a threaded fashion. This can be reopened if anyone has interest /intent to solve it. On Wed, Jan 16, 2002 at 07:50:03PM -0800, ashp@FreeBSD.org wrote: > Synopsis: Packet capture does not work well with -pthead option. > > State-Changed-From-To: open->suspended > State-Changed-By: ashp > State-Changed-When: Wed Jan 16 19:49:26 PST 2002 > State-Changed-Why: > Moved to suspended, based on bmah's comments. This libary isn't intended > to work in a threaded fashion. This can be reopened if anyone has interest > /intent to solve it. > > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28112 This can be closedi, patches are made and incorperated in -current and 4.5 See also http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/31649 and http://www.freebsd.org/cgi/query-pr.cgi?pr=22063 If the originator is interested I will have a look if I can find the patches and send them to him. Note, they were for 4.4, not 4.3. Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: ------------------+ http://www.FatalDimensions.org/ State Changed From-To: suspended->closed Closed as per bin/31649 and kern/22063. Thanks, Edwin! |