[racket] Places, Channels as Events. Labeling Places.
On Fri, 14 Dec 2012 07:25:36 +0100, David T. Pierson <dtp at mindstory.com>
wrote:
> I've wondered about this. What is the rational behind these
> differences? Wrapping events is cumbersome.
>
> For instance, my first intuition is that the synchronization result of a
> place channel would be the place channel itself, just like the
> synchronization result of a thread is the thread itself. Why aren't
> these analogous?
I would guess it prevents race-conditions. Channels and place-channels may
be accessed from any number of threads, and therefore it would be possible
that the data on the channel is removed between the sync and the
*-get-call. Thread channels are different in that it's guaranteed that
only one thread can access them.
Input-ports for example suffer from these races and the user has to make
sure to prevent or handle the them correctly.
Tobias
--
---------------------------------------------------------
Tobias Hammer
DLR / Institute of Robotics and Mechatronics
Muenchner Str. 20, D-82234 Wessling
Tel.: 08153/28-1487
Mail: tobias.hammer at dlr.de