Both BeginInvoke and EndInvoke on delegates generate full fences?

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.

+5
source share
2 answers

MSDN says BeginInvoke is streaming: http://msdn.microsoft.com/en-us/library/0b1bf3y3.aspx

There are four control methods that are thread safe: Invoke, BeginInvoke, EndInvoke, and CreateGraphics if the handle to the control is already created

-1
source

Microsoft - Reference Source

-1

All Articles