Threading in C # by Joseph Albahari briefly talks about this, stating:
The following implicitly generate complete fences:
- C # lock statement (Monitor.Enter / Monitor.Exit)
- All methods of the Interlocked class (close them well)
- Asynchronous callbacks that use the thread pool include: asynchronous delegates, APM callbacks, and task continuations
- Configuring and waiting for an alarm design
- Everything related to signaling, for example, starting or waiting for a task
Since there are “asynchronous delegates” in the list, I would suggest that at least EndInvoke is completely fenced. But what about BeginInvoke? Unfortunately, I could not F11 (= debug step) in BeginInvoke code - is this a source available somewhere? Although a link to a specific answer will be even better.
source
share