RFC: Thread-Local Storage Cleanup in Thread-Safe HDF5 for Windows

Hi all,

This is another (very) brief RFC that outlines how we will address some long-standing issues with thread-local storage in the Windows thread-safe code. Although no new public functionality will be exposed, the information may be of interest and I'd be interested in hearing from any static + thread-safe Windows users.

The new function will appear in HDF5 1.8.13, which will be released in May.

If anyone has any comments or concerns, please let us know.

Cheers,

Dana

RFC threadsafe tls issues v2.pdf (154 KB)

Hi Dana

IMHO this is a minor problem when it comes to threads and when it comes to
the HDF5 library robustness overall. When I allowed threads in HDF5 (now I
coordinate everything outside because it was a nightmare) I had really big
problems because of the logic that restores the state of the library after
an error. If everything goes as it has been carefully designed, it might
work. But when an error occurs, and threeads multiply the chances, the
cleanup logic is just so flawed. But this is a huge problem also with the
single thread, only with multiple threads it has higher chances. To see an
example of what I mean and with which I am currently having trouble, try
saving a file on an almost full USB stick.

m2c

-- ds

···

2014-03-24 19:41 GMT+01:00 Dana Robinson <derobins@hdfgroup.org>:

Hi all,

This is another (very) brief RFC that outlines how we will address some
long-standing issues with thread-local storage in the Windows thread-safe
code. Although no new public functionality will be exposed, the information
may be of interest and I'd be interested in hearing from any static +
thread-safe Windows users.

The new function will appear in HDF5 1.8.13, which will be released in May.

If anyone has any comments or concerns, please let us know.

Cheers,

Dana

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

As write there, this cleanup mechanism is not supported for static linkage. It looks like the same issues as global constructors/destructors in c++. Maybe it is acceptable to provide a cleanup mechanism via a small peace of C++ code where a global object's constructor/destructor does the same as what DllMain would do in a dynamic library.

          Werner

···

On 24.03.2014 19:41, Dana Robinson wrote:

Hi all,

This is another (very) brief RFC that outlines how we will address some long-standing issues with thread-local storage in the Windows thread-safe code. Although no new public functionality will be exposed, the information may be of interest and I'd be interested in hearing from any static + thread-safe Windows users.

The new function will appear in HDF5 1.8.13, which will be released in May.

If anyone has any comments or concerns, please let us know.

Cheers,

Dana

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

--
___________________________________________________________________________
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

This is a C library issue, so there are no constructors or destructors. Thread-safe & C++ bindings is currently an unsupported configuration.

Dana

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Werner Benger
Sent: Monday, March 24, 2014 5:09 PM
To: HDF Users Discussion List
Subject: Re: [Hdf-forum] RFC: Thread-Local Storage Cleanup in Thread-Safe HDF5 for Windows

As write there, this cleanup mechanism is not supported for static linkage. It looks like the same issues as global constructors/destructors in c++. Maybe it is acceptable to provide a cleanup mechanism via a small peace of C++ code where a global object's constructor/destructor does the same as what DllMain would do in a dynamic library.

         Werner

On 24.03.2014 19:41, Dana Robinson wrote:
Hi all,

This is another (very) brief RFC that outlines how we will address some long-standing issues with thread-local storage in the Windows thread-safe code. Although no new public functionality will be exposed, the information may be of interest and I'd be interested in hearing from any static + thread-safe Windows users.

The new function will appear in HDF5 1.8.13, which will be released in May.

If anyone has any comments or concerns, please let us know.

Cheers,

Dana

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

--

___________________________________________________________________________

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

Hi Dana

I think the valid request of Werner is that the same functions are made
available as an API so that we can use them even without the dllmain. I
also had the same thought but, frankly, I then thought that it would be
easier to hack the thing myself once you deliver it...

Cheers

-- ds

···

2014-03-25 15:06 GMT+01:00 Dana Robinson <derobins@hdfgroup.org>:

This is a C library issue, so there are no constructors or destructors.
Thread-safe & C++ bindings is currently an unsupported configuration.

Dana

*From:* Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] *On
Behalf Of *Werner Benger
*Sent:* Monday, March 24, 2014 5:09 PM
*To:* HDF Users Discussion List
*Subject:* Re: [Hdf-forum] RFC: Thread-Local Storage Cleanup in
Thread-Safe HDF5 for Windows

As write there, this cleanup mechanism is not supported for static
linkage. It looks like the same issues as global constructors/destructors
in c++. Maybe it is acceptable to provide a cleanup mechanism via a small
peace of C++ code where a global object's constructor/destructor does the
same as what DllMain would do in a dynamic library.

         Werner

On 24.03.2014 19:41, Dana Robinson wrote:

Hi all,

This is another (very) brief RFC that outlines how we will address some
long-standing issues with thread-local storage in the Windows thread-safe
code. Although no new public functionality will be exposed, the information
may be of interest and I'd be interested in hearing from any static +
thread-safe Windows users.

The new function will appear in HDF5 1.8.13, which will be released in May.

If anyone has any comments or concerns, please let us know.

Cheers,

Dana

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

--

___________________________________________________________________________

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.
Hdf-forum@lists.hdfgroup.org

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Such a mechanism was in the initial RFC, but after discussion we decided to punt the static library issue to 1.8.14, pending further discussion, while implementing the DllMain dynamic library fix in 1.8.13.

Dana

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Dimitris Servis
Sent: Tuesday, March 25, 2014 12:35 PM
To: HDF Users Discussion List
Subject: Re: [Hdf-forum] RFC: Thread-Local Storage Cleanup in Thread-Safe HDF5 for Windows

Hi Dana
I think the valid request of Werner is that the same functions are made available as an API so that we can use them even without the dllmain. I also had the same thought but, frankly, I then thought that it would be easier to hack the thing myself once you deliver it...
Cheers
-- ds

2014-03-25 15:06 GMT+01:00 Dana Robinson <derobins@hdfgroup.org<mailto:derobins@hdfgroup.org>>:
This is a C library issue, so there are no constructors or destructors. Thread-safe & C++ bindings is currently an unsupported configuration.

Dana

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org<mailto:hdf-forum-bounces@lists.hdfgroup.org>] On Behalf Of Werner Benger
Sent: Monday, March 24, 2014 5:09 PM
To: HDF Users Discussion List
Subject: Re: [Hdf-forum] RFC: Thread-Local Storage Cleanup in Thread-Safe HDF5 for Windows

As write there, this cleanup mechanism is not supported for static linkage. It looks like the same issues as global constructors/destructors in c++. Maybe it is acceptable to provide a cleanup mechanism via a small peace of C++ code where a global object's constructor/destructor does the same as what DllMain would do in a dynamic library.

         Werner
On 24.03.2014 19<tel:24.03.2014%2019>:41, Dana Robinson wrote:
Hi all,

This is another (very) brief RFC that outlines how we will address some long-standing issues with thread-local storage in the Windows thread-safe code. Although no new public functionality will be exposed, the information may be of interest and I'd be interested in hearing from any static + thread-safe Windows users.

The new function will appear in HDF5 1.8.13, which will be released in May.

If anyone has any comments or concerns, please let us know.

Cheers,

Dana

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

--

___________________________________________________________________________

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<tel:%2B1%20225%20578%204809> Fax.: +1 225 578-5362<tel:%2B1%20225%20578-5362>

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org