Skip to content
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

Make JitCache thread safe #11

Merged
merged 2 commits into from
Mar 17, 2018
Merged

Conversation

benbarsdell
Copy link
Member

- Adds mutex locks to allow multiple threads to safely use a single
  JitCache object.
- Fixes #10
@DavidPoliakoff
Copy link

This is fantastic, thanks!

- Changes single mutex into separate ones for kernel and program caches.
- Adds -pthread to Makefile.
- Wraps mutex code in JITIFY_THREAD_SAFE guards to allow it to be
  optionally disabled.
- Updates README to mention the need for compiling with -pthread.
- Adds a couple of checks to avoid segfaulting when thread races occur.
  There are still cases where a lack of thread safety can result in
  obscure error messages, but it's not clear how to catch these.
@benbarsdell benbarsdell merged commit 08ad0d8 into master Mar 17, 2018
@maddyscientist maddyscientist deleted the feature/thread-safe-jitcache branch December 20, 2019 07:21
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.

2 participants