From owner-freebsd-bugs Fri Jun 15 20:20:17 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 408CC37B403 for ; Fri, 15 Jun 2001 20:20:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5G3K3j01249; Fri, 15 Jun 2001 20:20:03 -0700 (PDT) (envelope-from gnats) Date: Fri, 15 Jun 2001 20:20:03 -0700 (PDT) Message-Id: <200106160320.f5G3K3j01249@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Brian Mitchell Subject: Re: kern/28112: Packet capture does not work well with -pthead option. Reply-To: Brian Mitchell Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/28112; it has been noted by GNATS. From: Brian Mitchell 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