thread safe work in windows for a hdf static?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

thread safe work in windows for a hdf static?

Isaac Gerg
I see in the docs that as of 1.8.6 hdf threadsafe is available for windows but only if you use link hdf shared.  Is this true with 1.8.17 (or the latest hdf version)?

Is thread safe available for hdf static in windows?

Thanks,
isaac

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: thread safe work in windows for a hdf static?

Werner Benger

Hi Isaac,

 as far as  I know the problem with static libraries is not the threadsafety of HDF5 itself, the code is the same, but the initialization & cleanup code. With a shared library, there are such defined entry points when loading and unloading a shared library which does a clean initialization and cleanup, but with a static library there is no such option. If you'd want to use threadsafe HDF5 with the static library, you would need to explicitly call the initialization & cleanup, for instance from your main program or from another shared library at startup/cleanup. I'm not sure whether HDF5 1.8.17 explicitly supports such, it may be possible but not implemented that way.

        Werner


On 03.10.2016 20:59, Isaac Gerg wrote:
I see in the docs that as of 1.8.6 hdf threadsafe is available for windows but only if you use link hdf shared.  Is this true with 1.8.17 (or the latest hdf version)?

Is thread safe available for hdf static in windows?

Thanks,
isaac


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

-- 
___________________________________________________________________________
Dr. Werner Benger                Visualization Research
Center for Computation & Technology at Louisiana State University (CCT/LSU)
2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809                        Fax.: +1 225 578-5362 

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: thread safe work in windows for a hdf static?

Dana Robinson

Hi all,

 

Werner is correct. You could build the thread-safe + static library with ALLOW_UNSUPPORTED (under the advanced options if you use ccmake) and implement the thread attach/detach code yourself. You can check out the code in DllMain() at the end of src/H5.c to see what we do, which is actually quite minimal. Basically, you just have to initialize and clean up thread-local storage when you attach and detach threads, respectively.

 

Cheers,

 

Dana Robinson

Software Engineer

The HDF Group

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Werner Benger
Sent: Tuesday, October 4, 2016 2:50 AM
To: [hidden email]
Subject: Re: [Hdf-forum] thread safe work in windows for a hdf static?

 

Hi Isaac,

 as far as  I know the problem with static libraries is not the threadsafety of HDF5 itself, the code is the same, but the initialization & cleanup code. With a shared library, there are such defined entry points when loading and unloading a shared library which does a clean initialization and cleanup, but with a static library there is no such option. If you'd want to use threadsafe HDF5 with the static library, you would need to explicitly call the initialization & cleanup, for instance from your main program or from another shared library at startup/cleanup. I'm not sure whether HDF5 1.8.17 explicitly supports such, it may be possible but not implemented that way.

        Werner

 

On 03.10.2016 20:59, Isaac Gerg wrote:

I see in the docs that as of 1.8.6 hdf threadsafe is available for windows but only if you use link hdf shared.  Is this true with 1.8.17 (or the latest hdf version)?

 

Is thread safe available for hdf static in windows?

 

Thanks,

isaac




_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5



-- 
___________________________________________________________________________
Dr. Werner Benger                Visualization Research
Center for Computation & Technology at Louisiana State University (CCT/LSU)
2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809                        Fax.: +1 225 578-5362 

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: thread safe work in windows for a hdf static?

Isaac Gerg
Thank you all.  

Just to be clear, is the native shared lib built with threadsafe?

On Tue, Oct 4, 2016 at 5:06 AM, Dana Robinson <[hidden email]> wrote:

Hi all,

 

Werner is correct. You could build the thread-safe + static library with ALLOW_UNSUPPORTED (under the advanced options if you use ccmake) and implement the thread attach/detach code yourself. You can check out the code in DllMain() at the end of src/H5.c to see what we do, which is actually quite minimal. Basically, you just have to initialize and clean up thread-local storage when you attach and detach threads, respectively.

 

Cheers,

 

Dana Robinson

Software Engineer

The HDF Group

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Werner Benger
Sent: Tuesday, October 4, 2016 2:50 AM
To: [hidden email]
Subject: Re: [Hdf-forum] thread safe work in windows for a hdf static?

 

Hi Isaac,

 as far as  I know the problem with static libraries is not the threadsafety of HDF5 itself, the code is the same, but the initialization & cleanup code. With a shared library, there are such defined entry points when loading and unloading a shared library which does a clean initialization and cleanup, but with a static library there is no such option. If you'd want to use threadsafe HDF5 with the static library, you would need to explicitly call the initialization & cleanup, for instance from your main program or from another shared library at startup/cleanup. I'm not sure whether HDF5 1.8.17 explicitly supports such, it may be possible but not implemented that way.

        Werner

 

On 03.10.2016 20:59, Isaac Gerg wrote:

I see in the docs that as of 1.8.6 hdf threadsafe is available for windows but only if you use link hdf shared.  Is this true with 1.8.17 (or the latest hdf version)?

 

Is thread safe available for hdf static in windows?

 

Thanks,

isaac




_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5



-- 
___________________________________________________________________________
Dr. Werner Benger                Visualization Research
Center for Computation & Technology at Louisiana State University (CCT/LSU)
2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.: <a href="tel:%2B1%20225%20578%204809" value="+12255784809" target="_blank">+1 225 578 4809                        Fax.: <a href="tel:%2B1%20225%20578-5362" value="+12255785362" target="_blank">+1 225 578-5362 

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: thread safe work in windows for a hdf static?

Dana Robinson

Not by default. The locking scheme has overhead so it's not enabled unless you ask for it.

 

Dana

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Isaac Gerg
Sent: Tuesday, October 4, 2016 9:42 AM
To: HDF Users Discussion List <[hidden email]>
Subject: Re: [Hdf-forum] thread safe work in windows for a hdf static?

 

Thank you all.  

 

Just to be clear, is the native shared lib built with threadsafe?

 

On Tue, Oct 4, 2016 at 5:06 AM, Dana Robinson <[hidden email]> wrote:

Hi all,

 

Werner is correct. You could build the thread-safe + static library with ALLOW_UNSUPPORTED (under the advanced options if you use ccmake) and implement the thread attach/detach code yourself. You can check out the code in DllMain() at the end of src/H5.c to see what we do, which is actually quite minimal. Basically, you just have to initialize and clean up thread-local storage when you attach and detach threads, respectively.

 

Cheers,

 

Dana Robinson

Software Engineer

The HDF Group

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Werner Benger
Sent: Tuesday, October 4, 2016 2:50 AM
To: [hidden email]
Subject: Re: [Hdf-forum] thread safe work in windows for a hdf static?

 

Hi Isaac,

 as far as  I know the problem with static libraries is not the threadsafety of HDF5 itself, the code is the same, but the initialization & cleanup code. With a shared library, there are such defined entry points when loading and unloading a shared library which does a clean initialization and cleanup, but with a static library there is no such option. If you'd want to use threadsafe HDF5 with the static library, you would need to explicitly call the initialization & cleanup, for instance from your main program or from another shared library at startup/cleanup. I'm not sure whether HDF5 1.8.17 explicitly supports such, it may be possible but not implemented that way.

        Werner

 

On 03.10.2016 20:59, Isaac Gerg wrote:

I see in the docs that as of 1.8.6 hdf threadsafe is available for windows but only if you use link hdf shared.  Is this true with 1.8.17 (or the latest hdf version)?

 

Is thread safe available for hdf static in windows?

 

Thanks,

isaac



_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

 

-- 
___________________________________________________________________________
Dr. Werner Benger                Visualization Research
Center for Computation & Technology at Louisiana State University (CCT/LSU)
2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.: <a href="tel:%2B1%20225%20578%204809" target="_blank">+1 225 578 4809                        Fax.: <a href="tel:%2B1%20225%20578-5362" target="_blank">+1 225 578-5362 


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

 


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Loading...