tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Moving pthread_(cond|mutex) to libc



On Fri, Jan 25, 2013 at 05:21:51PM +0000, David Holland wrote:
> That said, it's a fair point. If I'm writing a library, and I want the
> library to be safely usable by both threaded and unthreaded programs,
> is there anything I can do? Right now it seems the only fully viable
> approach is to build two versions and hope I can figure out how to get
> clients to link the right one, which is pretty sketchy.

You can use mutexes and cvs and a number of other things just fine.
The only thing you are not allowed to do is call pthread_create. That is
the problem with GLib2, where the calls to pthread_create are in the
main library, not even in libgthread.

Joerg


Home | Main Index | Thread Index | Old Index