[Haskell-cafe] Is it safe to create global variables using unsafePerformIO?

Ömer Sinan Ağacan omeragacan at gmail.com
Wed Jan 29 18:09:42 UTC 2014


> You would need the NOINLINE pragma

Ahh, right. Thanks for reminding.

> It isn't clear that
> this will give an improvement in performance

Why is that? I think it's clear since I'm eliminating malloc calls.
(though one may claim that malloc calls are so cheap it's not even
measurable)

> and what could otherwise
> possible be a thread safe API is no longer thread safe.

This is a fair point. Though in my case I don't think this is the case
because this API is already not thread safe, because of the C API and
not Haskell bindings.


---
Ömer Sinan Ağacan
http://osa1.net


More information about the Haskell-Cafe mailing list