Is there any windows API (application program interface) to execute thread on atomic mode?

closed as off-topic by perror, Jason Geffner, 0xec, jvoisin, newgre Apr 28 '16 at 19:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on software development are off-topic here, but can be asked on Stack Overflow." – perror, Jason Geffner, jvoisin, newgre
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What's "atomic mode"? – conio Apr 28 '16 at 14:09
  • execute operation without context switch – forbiddenhi May 3 '16 at 5:54
  • Obviously Not. That's what preemptive multitasking (in contrast to cooperative multitasking) means. Preemption means the operating system may preempt your thread at any moment (for any reason or for no reason at all as far as you're concerned), and it actually does. – conio May 3 '16 at 8:55

The Interlocked API may be what you are looking for. Or more generally, here is the MSDN topic on synchronization.

Not the answer you're looking for? Browse other questions tagged or ask your own question.