From owner-freebsd-stable Thu Mar 29 11:10:44 2001 Delivered-To: freebsd-stable@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 7594F37B71A for ; Thu, 29 Mar 2001 11:10:41 -0800 (PST) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id MAA07228; Thu, 29 Mar 2001 12:10:40 -0700 (MST) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id MAA12556; Thu, 29 Mar 2001 12:10:36 -0700 (MST) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15043.34912.938319.558188@nomad.yogotech.com> Date: Thu, 29 Mar 2001 12:09:20 -0700 (MST) To: Allen Landsidel Cc: freebsd-stable@FreeBSD.ORG Subject: RE: Threads vs. blocking sockets In-Reply-To: <4.3.2.7.2.20010329135405.00cab6b8@64.7.7.83> References: <4.3.2.7.2.20010329135405.00cab6b8@64.7.7.83> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > In my experience (on 4 or 5 Unix variants), with a blocking socket either > > > everything is sent or an error (or EOF on recv*) is returned. In fact > > > FreeBSD also does this, unless you link with libc_r instead of libc. > > > >Right, but in threaded systems, there are no 'blocking' sockets. You > >have to think differently when doing threaded applications. > > That is really backwards thinking. > > One of the benefits of threading is that you can use blocking sockets > inside each thread and you get the best of both worlds. Actually, no. At least in many threading libraries (including FreeBSD's), you can't use blocking sockets, because only one thread is allowed in the kernel. Therefore, if you call a blocking system call, *ALL* threads block, thus causing your entire application to 'hang'. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message