How to create atomic function in objective-c

Is there a way to execute an entire objective-c atomic function?

As far as I know, the use of synchronization only protects the specific world of code from the simultaneous execution of multiple threads. But I want ALL other threads to do NOTHING while I perform the function.

+3
source share
2 answers

The Thread Programming Guide ) has a wealth of information. He specifically mentions to avoid synchronization (which is ridiculous because you sometimes cannot), but they offer some suggestions on this issue.

, . , , . , , - .

+3

. .

, , , , , API- Mach ( Mac OS X).

.

, ?

+2

Source: https://habr.com/ru/post/1752276/


All Articles