tech-userlevel archive

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

Re: Moving pthread_(cond|mutex) to libc



>> 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 [...].  Applications which want the specific functionality in
> the API that requires threads link with -lose.  Applications that
> want the subset of the API that does not require threads link with
> -luse.

How is this not "two versions and hope [] clients [] link the right
one"?

Also, it's not necessarily a case of a subset of the API requiring
threads.  I suspect more likely is that the API is not explicitly
thread-aware, but behind-the-scenes locking is required when running
threaded.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index