9

I don't quite understand what eg HaLVM or similar technologies do in terms of (OS) threads.

I understand that when compiling code with the option -threaded then the Haskell multithreaded RTS will use OS threads to re-allocate existing Haskell threads and thus avoid blocking behaviour of foreign calls. Now, when you use the HaLVM you probably don't have to make any foreign calls. However, I wonder how this all blends, and how many worker threads the HaLVM does run. Are there no other situations where the absence of OS worker threads may lead to blocking or otherwise undesired behavior?

amirmc
  • 19
  • 6
J Fritsch
  • 3,338
  • 1
  • 18
  • 40

1 Answers1

9

The HaLVM uses the single-threaded GHC runtime.

Porting HaLVM to use the threaded runtime, with support from multicore Xen would be an interesting project.

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
  • But what undesirable consequences does this single threaded model have? In what situations? – J Fritsch Jan 15 '13 at 16:11
  • None. It just doesn't let you use more than 1 core. There are also some small semantic differences involving blocking IO. – Don Stewart Jan 15 '13 at 16:12
  • Thx, I assume it is possible to deploy a HaLVM on every core though? – J Fritsch Jan 15 '13 at 16:16
  • 2
    Yes, separate HALVMs can run on each core if you so desire. – Thomas M. DuBuisson Jan 16 '13 at 05:13
  • @ThomasM.DuBuisson What do they want to tell on slide#4 http://www.slideshare.net/xen_com_mgr/the-halvm-a-simple-platform-for-simple-platforms . Do they want to say that they researched a simple problem only or that the HaLVM keeps a slim call graph? – J Fritsch Jan 20 '13 at 21:38
  • @JFritsch Slide 4? That seems pretty explicitly spelled out, so correct me if I am looking at the wrong slide or not answering your question. Micro-kernels depend on many separate "server" processes that perform IPC. Designing these in such a way that there is no circular dependencies, which makes boot-up difficult or impossible, is non-trivial. HaLVM allows quick prototype implementations to prove (by example) that a particular design for the servers does not have such issues. – Thomas M. DuBuisson Jan 20 '13 at 22:20
  • @ThomasM.DuBuisson What's the difference between a Microkernel and an Exokernel? – J Fritsch Jan 21 '13 at 08:28