Date: Wed, 5 Feb 1997 14:41:56 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: lada@ws2301.gud.siemens.co.at (Hr.Ladavac) Cc: ljo@Mcs.Net, hackers@FreeBSD.ORG Subject: Re: sigwait and threads? Message-ID: <199702052141.OAA15633@phaeton.artisoft.com> In-Reply-To: <199702051749.AA254324944@ws2301.gud.siemens.co.at> from "Hr.Ladavac" at Feb 5, 97 06:49:04 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702052141.OAA15633>
