Skip to content

Handle C++ libraries without threading support. #1265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

xloem
Copy link
Contributor

@xloem xloem commented May 1, 2023

Adds preprocessor checks for __STDCPP_THREADS__ before making use of std::thread.

Standard definition of define: https://timsong-cpp.github.io/cppwp/n3337/cpp.predefined#2.6
Example of how header files function if it is not present: https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b50122a161b91f59f19c9bd0d19/include/thread#L109

Test failures were because older versions of gcc didn't have __STDCPP_THREADS__ yet.

  • added check for _GLIBCXX_HAS_GTHREADS for older gcc's
  • added chrono for perplexity example, which was previously coming in from one of the <thread> includes

@xloem xloem force-pushed the stdcppthreads branch from b0e95c0 to 9449557 Compare May 1, 2023 11:36
@xloem xloem marked this pull request as draft May 1, 2023 11:53
@xloem xloem force-pushed the stdcppthreads branch 2 times, most recently from 7493956 to 8b5e6a8 Compare May 1, 2023 12:46
@xloem xloem marked this pull request as ready for review May 1, 2023 12:57
@xloem xloem force-pushed the stdcppthreads branch from 8b5e6a8 to 14fa3d1 Compare May 1, 2023 23:05
@evanmiller
Copy link
Contributor

@howard0su I see you have done some threading work, what do you think of this change?

@ggerganov
Copy link
Member

I don't think it is worth supporting this as the application is very niche.
The change is rather simple for anyone how needs it to custom implement it in their project

@ggerganov ggerganov closed this Jul 9, 2023
@xloem
Copy link
Contributor Author

xloem commented Jul 9, 2023

To clarify, my usecase was wasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants