"Manuel M. T. Chakravarty" wrote:
> [...]
>The specification says in Section 4.6 (about "safe" and "unsafe"
> C calls) that in case of a "safe" call, a new OS thread is
> spawned to execute the called C
As I understand, it's fine to run them in new OS thread , because safe
functions should be pure and should have no side effects.
> [...]
> This is interesting because GTK+ is not thread-safe (as far
> as I know, partially because X is not thread-safe and GTK+
> makes no attempt at guarding its X calls against re-entry).[1]
The GTK+ functions are not safe, because they have side effects.
Therefore these functions belong into the IO monad and will *not* be
run in a separate OS thread (as long you do not create your own threads).
> [...]
So there is no problem at all, except when you declare functions as safe
that are not safe.
Cheers,
Herbert