|
From: Ian C. <co...@st...> - 2001-09-11 02:42:21
|
On Sun, 9 Sep 2001, Frank V. Castellucci wrote: > To answer your first question: > > It is all to often we see the myopic view of the world where context > often become part of a static type. For example, rather than take the > time to create things like semaphore pools, a developer unilateraly > decided that each SP type (A, B, Foo, etc.) has a single semaphore in a > static variable. ugh. Um... I don't follow. I'm sure it's just my inexperience shining through. Each SP obviously needs a (dumb) pointer and a reference count. Modifications to these need to be thread safe, right? Now... it would be pure evil to give each SP type a static locking mechanism. I've done it by giving each SP instance a mutex, but is this overkill? You mention semaphores... are you talking about implementing mutexes/critical sections (for pointer/ref. count mods) with semaphores? If not, I'm lost. As for semaphore pools... are you talking about something clever to avoid my (wasteful?) "mutex for each instance" scheme? Like I said, I don't follow. :( > And now that you brought it up (if you knew it or not with reference count): > > 8. Reference counts must be guarded > 9. Object state must be guarded > > Thoughts? Does this replace #7 or is it over and above it? If the latter, then what does #7 really mean? [for reference...] > >>7. Must be re-entrent -- ----------------------------- http://www.stasis.org/~codic/ |