Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Look up "Lock-Free Data Structures." See also the LMAX Disruptor. Commented Jun 1, 2019 at 15:44
  • Are you looking for a "barrier" instead? Commented Jun 2, 2019 at 21:32
  • 1
    How does using a lock lose the benefit of parallelism? If all of your threads are waiting for something to happen before proceeding (great use for a barrier, BTW), there's no parallelism to be lost because they're all idle anyway. Commented Jun 3, 2019 at 2:31
  • 1
    @Blrfl a single lock makes a serial section and they all need to pass it one by one as far as i understand. i don't mind using a lock, i'm basically asking if there's a lock that doesn't induce serialization, that multiple threads can pass in parallel. Commented Jun 6, 2019 at 20:08
  • What about a reader writer lock stackoverflow.com/questions/244316/reader-writer-locks-in-c stackoverflow.com/questions/31622059/… Commented Aug 26, 2021 at 0:26