From owner-freebsd-hackers Wed Feb 5 13:46:09 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA14349 for hackers-outgoing; Wed, 5 Feb 1997 13:46:09 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id NAA14331 for ; Wed, 5 Feb 1997 13:45:55 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA15633; Wed, 5 Feb 1997 14:41:57 -0700 From: Terry Lambert Message-Id: <199702052141.OAA15633@phaeton.artisoft.com> Subject: Re: sigwait and threads? To: lada@ws2301.gud.siemens.co.at (Hr.Ladavac) Date: Wed, 5 Feb 1997 14:41:56 -0700 (MST) Cc: ljo@Mcs.Net, hackers@FreeBSD.ORG In-Reply-To: <199702051749.AA254324944@ws2301.gud.siemens.co.at> from "Hr.Ladavac" at Feb 5, 97 06:49:04 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Another difference that DCE requires and Draft 8 has thrown out is > pthread_detach(). Ouch. This sucks bad. I have four threading models available, each with a different level of concurrency. I'll use the Microsoft names for them, and draw a better picture than Microsoft has ever drawn for them. Microsoft can pay me to use my picture, if they want it. 8-). Key: [1] Caller 1 (a) Context a ,----. |A | Thread A `----' Call Flow Concurrency model ----------------------------- ----------------------------- 1. Single threaded o One object for all caller instances o Object is not multithreaded o Object is not thread reentrant o Threads are not context reentrant o Calls are serialized, not concurrent ____________ [1] \ | | [1]--> v | ,----. | [2]->O-->|---|A(a)|-->|--> [2]--> ^ | `----' | [3] / |____________| [3]--> 2. Apartment threaded o One object for all caller instances o One thread per caller instance o Object is multithreaded o Object is not thread reentrant o Threads are not context reentrant o Calls are serialized, but appear concurrent ____________ | | | ,----. | [1]->O-->|---|A(a)|-->|--> [1]--> | `----' | | ,----. | [2]->O-->|---|B(b)|-->|--> [2]--> | `----' | | ,----. | [3]->O-->|---|C(c)|-->|--> [3]--> | `----' | |____________| 3. Rental Threaded o One object for all caller instances o Threads are not instanced per caller instance o Object is multithreaded o Object is thread reentrant o Threads are not context reentrant o Calls are thread concurrent; for N callers of M threads, where N > M, serialization is N div M ____________ | | | ,----. | [1]->O-->|---|A(a)|-->|--> [1]--> | `----' | | ,----. | [2]->O-->|---|B(b)|-->|--> [2]--> | `----' | | ,----. | [3]->O-->|---|A(c)|-->|--> [3]--> | `----' | |____________| 4. Free Threaded o One object for all caller instances o Threads are not instanced per caller instance o Object is multithreaded o Object is thread reentrant o Threads are context reentrant o Calls are context concurrent to the ability of a thread to process multiple blocking operations by making the call and reentring on another context ____________ | | | ,----. | [1]->O-->|---|A(a)|-->|--> [1]--> | `----' | | ,----. | [2]->O-->|---|B(b)|-->|--> [2]--> | `----' | | ,----. | [3]->O-->|---|A(c)|-->|--> [3]--> | `----' | |____________| Without thread attach/detach notification, I can't implement my callable objects as being Rental or Free threaded. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.