Skip to content

Instantly share code, notes, and snippets.

@sustrik
Last active September 27, 2015 10:04
Hi all,
Given that there were no complaints about the latest release candidate I am happy to
announce that a stable version of libmill was released today.
Let me take advantage of the opportunity to summarise once again what the project is all about:
In past quarter of century an unbelievable amount of programmer time and effort was wasted on
writing and debugging multithreaded programs. If I am writing a hotel booking application,
I don't want to write code to implement atomicity or isolation of transactions. Database
does that for me. So why should I write code to synchronise access to the shared data?
Why should I even understand a concept like condition variable or semaphore? Surely, experts
in the area should do the hard work for me.
Interestingly, before threads appeared, we've already had a nice, clean, easy-to-understand
and scalable model for writing concurrent and parallel applications, namely the old and proven
UNIX model of processes communicating via pipes. When the threads hit it was like we forgot
everything we used to know before. Luckily though, the good old CSP paradigm is seeing its
revival nowadays, be it in Go or Erlang. The difference, though, is that these new
implementations are much more efficient than processes and pipes ever were. And libmill is
entering this landscape on the C side.
The main design goals were:
-⁠ Use Go syntax, as that's the most widely known CSP-⁠based API.
- Limited scope. Implement "go", "make(chan"), "<-" and "select" constructs and nothing else.
-⁠ Simple library with both static and dynamic linking.
-⁠ No dependencies.
- Extra fast, starting coroutines and context switching should take just few machine instructions.
- Minimise numer of memory allocations (one per coroutine and one per channel).
- Add simple TCP library, so that people can start using it straight away.
- Do our best to make it work with different compilers, OSes and microarchitectures.
-⁠ Make it permissively licensed so that it can be used in any context.
- Make it functionally complete, so that it doesn't have to change in the future.
So, here's thing:
Short syntax overview: http://libmill.org
Documentation: http://libmill.org/documentation.html
Tutorial: http://libmill.org/tutorial.html
Download: http://libmill.org/download.html
Enjoy!
Martin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment