public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Pthreads-win32 and static linking
@ 2010-05-10 19:50 Martin Lambers
  2010-05-10 20:03 ` Ramiro Polla
  2010-06-20  5:15 ` Ross Johnson
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Lambers @ 2010-05-10 19:50 UTC (permalink / raw)
  To: pthreads-win32, ross.johnson

Hello!

The Mingw-cross-env project provides a MinGW cross-compiling environment
for POSIX systems. For various reasons, all included libraries are
static, including the pthreads-win32 library.

This means that all pthreads users need to call
pthread_win32_thread_attach_np() and pthread_win32_thread_detach_np() in
each thread function.

We would like to avoid patching all libraries that use pthread, and
instead change pthreads-win32: instead of using a thread main function
given to pthread_create() directly, pthreads-win32 could use an internal
wrapper that calls the thread main function and also calls the
attach/detach functions if necessary.

To avoid the pthread_win32_process_attach() function, pthreads-win32
could check on each function call whether the library was initialized,
and if not, call pthread_win32_process_attach() itself.

This would induce some overhead, but would allow us to use a large
number of existing libraries unchanged.

Before we start to work on a patch, we would like to know if this
approach has a chance to work. Do you know any technical reasons why
this might fail?

Best regards,
Martin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-23 12:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-10 19:50 Pthreads-win32 and static linking Martin Lambers
2010-05-10 20:03 ` Ramiro Polla
2010-06-20  5:15 ` Ross Johnson
2010-07-23 12:09   ` John E. Bossom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).