[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tool class (Long... *real* Long)
From: |
Theodore C. Belding |
Subject: |
Re: Tool class (Long... *real* Long) |
Date: |
Thu, 20 Mar 1997 02:19:00 -0500 |
Hi Ken-
At 1:17 AM -0500 3/20/97, Ken Cline wrote:>Problems:
> (1) How does agent B assure that object X's data isn't
> altered while B is using X?
Sounds like a job for a mutual exclusion (mutex) semaphore. See any decent
OS textbook, e.g., Silberschatz, A., and P. B. Galvin. (1994). Operating
Systems Concepts, 4th ed. Addison-Wesley. p. 177
> (2) Who, agent A or agent B or ???, has the
> responsibility for dropping the shared object X?
Sounds like a classic place to use reference counting or reference-counted
smart pointers. See:
Meyers, S. (1996). More Effective C++. Addison-Wesley. pp. 183-213.
or
Barton, J. J., and L. R. Nackman (1994). Scientific and Engineering C++.
Addison-Wesley. p. 425
(Both are C++-specific, but the concept is general. Maybe someone else can
suggest a more general reference.) Of course, you could also just use
garbage collection, if it is available.
Hope that helps.
-Ted
--
Ted Belding <mailto:address@hidden>
University of Michigan Program for the Study of Complex Systems
<http://www-personal.engin.umich.edu/~streak/>