LWN.net Logo

Coroutines

Coroutines

Posted May 8, 2012 19:03 UTC (Tue) by endecotp (guest, #36428)
In reply to: Coroutines by juliank
Parent article: nPth - The new GNU portable threads library

> Threads don't need locking if you only use message
> passing between threads

How do you implement your message passing? Most likely it needs some form of locking internally.

I would express it this way: don't try to implement your multi-threaded application using ad-hoc locking / synchronisation. Instead put all of the locking into some concurrency building blocks and restrict your inter-thread communication to only those building blocks. Message passing is one possible set of building blocks, but there are others.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds