Hello All - On Wed, Aug 25, 2010 at 5:09 PM, Kai Tietz <[email protected]> wrote: > 2010/8/25 Ruben Van Boxem <[email protected]>: >>> >>> Brand new idea: I define >>> #define _GLIBCXX_HAS_GTHREADS 1 >>> >>> This adds thread to std:: and allows me to see what undefined stuff there >>> is! Perfect, no? I'll keep you guys informed. >>> >>> Ruben >> ... >> Some additional thoughts: >> ... >> 3. missing types and functions: >> __gthread_time_t will have to be defined to time.h's (actually >> sys/timeb.h's) struct timespec (as in gthr-posix.h). >> __gthread_cond_t is harder than the previous, see for example: >> http://www.cs.wustl.edu/~schmidt/win32-cv-1.html) >> ... (many more, but can't say for sure if the two above aren't the problem) >> ... >> Ruben > > Ruben, > > for this we need a posix emulation library, or have to implement in > gthr-win32.h such a beast. For details when __GTHREAD_CXX0X should be > set to 1, see in gcc/gthr.h > > If the following are also defined, you should > #define __GTHREADS_CXX0X 1 > to enable the c++0x thread library. > > Types: > __gthread_t > __gthread_time_t > > Interface: > int __gthread_create (__gthread_t *thread, void *(*func) (void*), void *args); > int __gthread_join (__gthread_t thread, void **value_ptr); > int __gthread_detach (__gthread_t thread); > int __gthread_equal (__gthread_t t1, __gthread_t t2); > __gthread_t __gthread_self (void); > int __gthread_yield (void); > int __gthread_mutex_timedlock (__gthread_mutex_t *m, const > __gthread_time_t *abs_timeout); > int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t > *m, const __gthread_time_t *abs_time); > int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t > *m, const __gthread_time_t *abs_time); > int __gthread_cond_signal (__gthread_cond_t *cond); > int __gthread_cond_timedwait (__gthread_cond_t *cond, > __gthread_mutex_t *mutex, const __gthread_time_t *abs_timeout); > int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond, > __gthread_recursive_mutex_t *mutex, const __gthread_time_t *abs_time) > > If this API is implemented for win32 native, then we can have c++0x > standard conformancy.
Quoting a little from the "native builds" thread for continuity: On Wed, Aug 25, 2010 at 3:21 PM, NightStrike <[email protected]> wrote: > On Wed, Aug 25, 2010 at 1:51 PM, K. Frank <[email protected]> wrote: >> Hello All - >> >> On Wed, Aug 25, 2010 at 8:34 AM, John E. / TDM <[email protected]> wrote: >>> ... >>> "gthreads" is just a few source files in GCC that create a >>> platform-independent interface for GCC's threading functions. It wraps >>> pthreads on POSIX platforms, and WinAPI threads on Windows. >> >> This is speculation, and/or an ignorant question on my part... >> >> If "gthreads" already wraps windows threads (per John), and gcc's >> std::thread is implemented using gthreads (speculation due to the >> "#if defined(_GLIBCXX_HAS_GTHREADS)" wrapper in gcc's thread >> header file), then perhaps it would be relatively straightforward to try >> to get std::thread working with mingw gcc. > > This might help: > http://gcc.gnu.org/viewcvs/trunk/gcc/gthr-win32.h?view=markup Thank you for the link. This appears to be (very nearly) the same file as gthr-default.h in my version 4.4.1 mingw gcc installation. (I do not have a file named gthr-win32.h.) I do not know how to navigate http://gcc.gnu.org/viewcvs/trunk/gcc but poking around, I do not find a "thread" file (the include file for std::thread). My mingw gcc installation does have a "thread" file. (I realize that it may be out of date, but it's all I have.) I see, as Ruben pointed out, that it references (either directly or indirectly) __gthread_cond_t __gthread_time_t (and related), and that these are not defined in gthr-win32.h. Do I take it correctly that the windows version of gthreads does not implement all of the features in the linux/posix version, and that some of these features are needed by the gcc implementation of std::thread? And that our discussion here is basically about sticking with the existing gcc implementation of std::thread and getting it to work on windows by adding the missing features to the windows version of gthreads? Thanks. K. Frank > Regards, > Kai ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
