HaLVM and threads
Asked Answered
F

1

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?

Foolish answered 15/1, 2013 at 15:56 Comment(0)
W
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.

Witte answered 15/1, 2013 at 16:9 Comment(7)
But what undesirable consequences does this single threaded model have? In what situations?Foolish
None. It just doesn't let you use more than 1 core. There are also some small semantic differences involving blocking IO.Witte
Thx, I assume it is possible to deploy a HaLVM on every core though?Foolish
Yes, separate HALVMs can run on each core if you so desire.Caneghem
@ThomasM.DuBuisson What do they want to tell on slide#4 slideshare.net/xen_com_mgr/… . Do they want to say that they researched a simple problem only or that the HaLVM keeps a slim call graph?Foolish
@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.Caneghem
@ThomasM.DuBuisson What's the difference between a Microkernel and an Exokernel?Foolish

© 2022 - 2024 — McMap. All rights reserved.