On 10/14/2014 06:53 AM, Daiki Ueno wrote: > Pádraig Brady <p...@draigbrady.com> writes: > >> There are many consequences to having multiple threads, >> so it's worth avoiding/isolating that where possible. >> >> You mentioned it would be conditionalized on pthread_is_threaded_np >> for performance I suppose, as threaded progs would already >> have to deal with the consequences of a separate thread. >> So races in pthread_is_threaded_np would only be a small >> performance issue. >> >> Seems like a good idea to me. > > Thanks for the comment. Here is a tentative patch based on the > PostgreSQL patches. Perhaps it might require a copyright assignment > from the original author (Cc'ed).
Is AC_CHECK_FUNCS sufficient to find pthread_is_threaded_np()? I.E. is LIB_PTHREAD required to find this function on darwin? It's tempting to simplify actually and unconditionally call the forked version, as this isn't a function that would be in a hot path. thanks, Pádraig.