Why write out-of-line PrimOps in Cmm?

Alexander Kjeldaas alexander.kjeldaas at gmail.com
Thu Feb 14 12:55:56 CET 2013


I was looking at the eventlog code, and I wanted to move processing of a
full eventlog buffer into Haskell, instead of the now fixed behavior of
writing the data to a file.

To do this, I though that having a haskell process blocked on an MVar, or
Chan would be nice, and then some way to signal the process.

But the low-level PrimOps for MVars, takeMVar, tryTakeMVar etc are in
PrimOps.cmm and I don't know how to call them from the RTS.

This lead me to question what the point of out-of-line PrimOps in
PrimOps.cmm is.  I don't think the commentary covers this.

http://hackage.haskell.org/trac/ghc/wiki/Commentary/PrimOps

So why aren't all the stuff in PrimOps.cmm just "ccall" wrappers around C
implementations?  Wouldn't that in general be more flexible for the RTS?

Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130214/2819b707/attachment.htm>


More information about the ghc-devs mailing list