0 votes
14 views

How does dispatch_once manages to run only once?

in Technology by (189k points)

1 Answer

0 votes
dispatch_once() is synchronous process and all GCD methods do things asynchronously (case in point, dispatch_sync() is synchronous)
The entire idea of dispatch_once() is “perform something once and only once”, which is precisely what we’re doing. dispatch_once that’s used to guarantee that something happens exactly once, no matter how violent the program’s threading becomes.
by (189k points)

Related questions

0 votes
1 answer 16 views
16 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 19 views
19 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 14 views
14 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 13 views
0 votes
1 answer 14 views
14 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 10 views
10 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 19 views
0 votes
1 answer 22 views
0 votes
1 answer 14 views
0 votes
1 answer 12 views
12 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 11 views
0 votes
1 answer 37 views
37 views asked Jan 8 in Technology by JackTerrance (189k points)
0 votes
1 answer 11 views
11 views asked Nov 14, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 10 views
10 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 14 views
0 votes
1 answer 12 views
12 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
...