[Haskell-cafe] Project postmortem

Tomasz Zielonka tomasz.zielonka at gmail.com
Fri Dec 2 07:10:39 EST 2005

On Fri, Dec 02, 2005 at 11:20:54AM -0000, Simon Marlow wrote:
> If anyone is interested, this turned out to be a bug in the Network.BSD
> module, namely that getHostByName isn't thread safe because it is based
> on the C library function gethostbyname(), which returns data in a
> single static area.
> Workarounds are:
>   - do your own mutual exclusion locking around getHostByName and any
>     function that calls it (eg. connectTo).
>   - use Network.Alt (http://www.cs.helsinki.fi/u/ekarttun/network-alt/),
>     which has a thread-safe implementation of getHostByName.
>   - wait for 6.4.2, which will contain a fix for this bug (we don't have
>     a fix committed yet, Einar Karttunen has kindly offered to look into
> it).

Do I understand correctly that another workaround is
    - don't compile your programs with -threaded

Best regards

I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland

More information about the Haskell-Cafe mailing list