Scott,

I compiled pthreads for 64bit almost out of the box. It works fine so far
with HDF5. Note that I linked statically in order not to mess with any other
library. To make it work, you need to patch pthreads (see below). I also
added the following lines in H5TS.c in H5TS_first_thread_init, but that's
only for static linking

#ifdef _WIN32
#ifdef PTW32_STATIC_LIB
pthread_win32_process_attach_np();
#endif
#endif

HTH

-- dimitris

Index: implement.h
===================================================================
--- implement.h    (revision 19389)
+++ implement.h    (revision 19390)
@@ -667,8 +667,12 @@
  * See ptw32_InterlockedCompareExchange.c
  */
 #ifndef PTW32_INTERLOCKED_COMPARE_EXCHANGE
+#ifdef _WIN64
+#define PTW32_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
+#else
 #define PTW32_INTERLOCKED_COMPARE_EXCHANGE
ptw32_interlocked_compare_exchange
 #endif
+#endif

 #ifndef PTW32_INTERLOCKED_EXCHANGE
 #define PTW32_INTERLOCKED_EXCHANGE InterlockedExchange

Index: ptw32_InterlockedCompareExchange.c
===================================================================
--- ptw32_InterlockedCompareExchange.c    (revision 19389)
+++ ptw32_InterlockedCompareExchange.c    (revision 19390)
@@ -34,6 +34,7 @@
  *      if not, write to the Free Software Foundation, Inc.,
  *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
+#ifndef _WIN64

 #include "pthread.h"
 #include "implement.h"
@@ -301,3 +302,5 @@
 #endif

 #endif
+
+#endif

Index: pthread_win32_attach_detach_np.c
===================================================================
--- pthread_win32_attach_detach_np.c    (revision 19389)
+++ pthread_win32_attach_detach_np.c    (revision 19390)
@@ -91,6 +91,14 @@

 #endif

+#ifdef _WIN64
+/*
+ * InterlockedCompareExchange routine in WIN64 is an intrinsic function.
+ * See PTW32_INTERLOCKED_COMPARE_EXCHANGE implement.h
+ */
+
+#else
+
 #ifdef WINCE

   /*
@@ -143,6 +151,7 @@
     {
       ptw32_features |= PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE;
     }
+#endif

   /*

    * Load QUSEREX.DLL and try to get address of QueueUserAPCEx



2010/3/19 Mitchell, Scott - IS <[email protected]>

>  I implemented the thread safe version of HDF5 for Windows to get past
> some issues writing to HDF5 files from different threads. I hoped I didn’t
> need to bother since each thread had exclusive access to one file, but
> testing proved otherwise.
>
>
>
> So the thread-safe option uses PThreads (32 bit). This code will shortly be
> moving to a 64 bit platform. A quick search didn’t turn up a 64 bit variant.
> Is there a way to implement this in 64 bit?
>
>
>
>
>
> Scott
>
> ------------------------------
> This e-mail and any files transmitted with it may be proprietary and are
> intended solely for the use of the individual or entity to whom they are
> addressed. If you have received this e-mail in error please notify the
> sender.
> Please note that any views or opinions presented in this e-mail are solely
> those of the author and do not necessarily represent those of ITT
> Corporation. The recipient should check this e-mail and any attachments for
> the presence of viruses. ITT accepts no liability for any damage caused by
> any virus transmitted by this e-mail.
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to