c# - Interlocked.Exchange and value types
- From: "steve" <steve@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 31 Jul 2005 21:08:09 -0700
// What I want to do
Use enumerated types with the Interlocked.Exchange methods
Suggestions please
// My estimation of problem
Seems like Interlocked.Exchange only works with ints, referencable objects,
and floats
// Background
I have a class that wraps up a worker thread to handle various requests
The thread function is implemeted as a looped switch based state machine
The state machine states are enumerated (via an enum)
Requests are made by the client through various methods exposed by the class
Requests are embodied using the enumeration described above
The requested enum state variable gets filed away via interlocked exchange
for later retrieval by worker thread..
// Confessions
works fine with C++ and CRTL. I'm a C# newbie
cheers
.
- Follow-Ups:
- RE: c# - Interlocked.Exchange and value types
- From: steve
- RE: c# - Interlocked.Exchange and value types
- Prev by Date: I need a trigger
- Next by Date: Re: Create Generic Collection at Runtime
- Previous by thread: I need a trigger
- Next by thread: RE: c# - Interlocked.Exchange and value types
- Index(es):
Relevant Pages
|