glib thread create API



I'm posting this here because I expect it's going to turn into a dev discussion about gthreads.

I see that glib_thread_new_full() was deprecated. I'm building a low-level runtime that wants to control both size (probably a single size will suffice) and placement of the thread stacks. That is: I want to allocate the storage that is used for the thread stack. Which in turn means I probably need a teardown callback. This is clearly a low-level API issue, but I'm kinda stuck, because GTK relies on GLIB mutexes, which seem to rely on GThread.

The Mono implementation may have run into related issues. Mono uses both GLIB and GTK, but appears to use pthreads rather than glib threads. I'm not sure how they are mating the two, unless by incestuous knowledge of the glib implementation.

The old glib_thread_new_full() API wouldn't have covered this either, and I suspect it was obsoleted for a reason. Before I dig into this too far, can somebody point me at the discussion thread on why glib_thread_new_full() was removed? I see the commit messages in the archives, but I don't see a discussion of rationale.

Also, can someone explain what happens when a glib thread runs off the end of its (arbitrarily sized) stack? I don't see behavioral documentation for that. :-)

Finally, is there a discussion anywhere on how to deal with situations where you have one block of code that really wants to use pthreads, and another that really wants to use glib/gtk?

Thanks in advance


Jonathan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]