lhmouse / mcfgthread

Cornerstone of the MOST efficient std::thread on Windows for mingw-w64
https://gcc-mcf.lhmouse.com/
Other
277 stars 28 forks source link

Change log for v1.4 #76

Closed lhmouse closed 1 year ago

lhmouse commented 1 year ago

New features

  1. A new function _MCF_thread_new_aligned() has been introduced for allocating aligned user-defined data.
  2. A new function _MCF_tls_key_get_destructor() has been added, which gets the destructor of a TLS key.
  3. It is now possible to manage the reference count of a TLS key with _MCF_tls_key_get_ref() and _MCF_tls_key_drop_ref().
  4. A new function _MCF_tls_xset() has been added, which sets a new value and optionally gets its old value.
  5. Some new functions have been added to retrieve system information: _MCF_get_page_size(), _MCF_get_processor_count(), _MCF_get_active_processor_mask().
  6. A new header <mcfgthread/cxx11.hpp> has been added, which contains reference implementations of C++11 std::once_flag, std::mutex, std::timed_mutex, std::recursive_mutex, std::recursive_timed_mutex, std::conditon_variable and std::thread. This header is a drop-in replacement for toolchains that lack standard threading support, such as GCC with the win32 thread model.

Improvements

  1. (v1.3-ga.3) Attempting to join with the calling thread itself, which will always fail, no longer makes it non-joinable.
  2. (v1.3-ga.3) _MCF_event_await_change() now returns the current value of an event, which is a byte and is thus always non-negative, instead of zero. This is an ABI break if code checks for success by comparing the result with zero.
  3. C11 functions are now 'true' functions with file scope.
  4. When creating a thread, if no user-defined data should be requested by passing a size of zero to _MCF_thread_new(), _MCF_thread_get_data() now returns a null pointer on the new thread. Specifically, this behavior is now consistent with the main thread.