Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

[linux-port] Thread-local storage #173

Closed

Description

@ehsannas

In a few places in the codebase, TlsAlloc, TlsSetValue, TlsGetValue, and TlsFree are used. While these functions are available on the Windows platform, they are not on Linux/MacOS.

As a result, we should use an alternative. Currently, I have used the standard C++ thread_local keyword to handle these cases on Linux. However, it's been brought to my attention that compiling thread_local using Clang on MacOS does not work properly. As a result, we should use pthread_key_.... Ultimately, we should have Tls* for Windows and pthread* for all other platforms.

So, the thread_local implementation should be removed from the following files and be replaced with pthread implementation:

dxcmem.cpp
Path.inc

Activity

  1. pow2clk commented on May 16, 2018

    @pow2clk

    I have an implementation of this. It's running into a few shared lib setup and shutdown issues where the retrieval of the IMalloc pointer is concerned. I have something that works, but I'm not sure if it's the right approach.

  2. ehsannas commented on Jun 5, 2018

    @ehsannas
    Author

    Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions