Ignorant newbie here, but would love to hear views on this: I always treat with great skepticism claims that you can implement an inherent operating system function (eg: threads) on top of said operating system more efficiently than can be done by the OS itself. Usually it means the implementor simply didn't understand the next level down (eg: how the kernel works) and therefore couldn't tune it to their needs. But t…
I don't disagree with other answers, but I believe the situation can be described more easily: it isn't the same primitive, so, it isn't actually the case that someone is attempting to provide the same thing but faster: the OS is giving you "pre-emptive threads", whereas these alternatives are giving you "cooperative threads". The argument is that for restricted use cases "cooperative threads" (which are the "dual",…
Show HN: Lightweight Threads, Channels and Actors for the JVM
51–56 of 56 posts
Re: Show HN: Lightweight Threads, Channels and Actors for the JVM
#52Earlier quoted context omitted.
I don't disagree with other answers, but I believe the situation can be described more easily: it isn't the same primitive, so, it isn't actually the case that someone is attempting to provide the same thing but faster: the OS is giving you "pre-emptive threads", whereas these alternatives are giving you "cooperative threads". The argument is that for restricted use cases "cooperative threads" (which are the "dual",…
GHC's runtime (an implementation of Haskell) uses pre-emptive scheduling for its threads and has no problem handling millions of lightweight threads.
In fact, there are trivial kinds of operations you can perform (such as involving FFI) that simply will never pre-empt. The primitive the operating system provides, which I maintain is a fundamentally different primitive than what people are building in these user-space modifications, is "no matter what you do, whether on accident or on purpose, whether with benign or malicious intent, you will be time-sliced; your time-slicing will thereby happen at the discretion of the system, and you will not be trusted to request or demand excessive modifications to your time". GHC is not some magic exception: it is still cooperative multitasking.
Re: Show HN: Lightweight Threads, Channels and Actors for the JVM
#53Re: Show HN: Lightweight Threads, Channels and Actors for the JVM
#54I am newbie to go, but running the go version took about 186.053167ms, wonder how to explain this behavior http://play.golang.org/p/flK5QV-mDC Go Version : devel +740d244b2047 Thu May 02 18:59:39 2013 -0700
What was MAXPROCS set to? It's a lot faster to run this particular benchmark with only one thread.
Re: Show HN: Lightweight Threads, Channels and Actors for the JVM
#55Re: Show HN: Lightweight Threads, Channels and Actors for the JVM
#56Interesting ! Regarding to your own Queue implementations, did you consider using the disruptor ( http://lmax-exchange.github.io/disruptor/ - which is actually an advanced ring buffer)? Martin Thompson was also involved in that project.