Comments (8)
I might be missing something, but what would networking have to do with a C11 threads implementation?
from c11threads.
There are very few threads.h implementations atm, and looks like no implementation for Windows. threads.h meant to be platform-independent header, so would be nice to add win support in one place, otherwise community will end-up with two different headers :(
from c11threads.
Probably most of stuff could be copy-pasted from here https://github.com/tinycthread/tinycthread with saving license note.
from c11threads.
So you meant "windows threads", not "windows sockets". Then sure, it would be nice to have C11 threads on windows.
But I don't think this is the place to do that. I have implemented pthreads on windows in the past, and the problem is the win32 API doesn't have a condvar-equivalent construct. This means that a full implementation of C11 threads can't really be a header-only thin wrapper, but rather a full library, like the one you linked. So I suggest using that one instead if you care about windows compatibility.
Still, having said that, if someone cares to contribute a win32 implementation to this "project", and it's clean and well written enough, I will include it.
from c11threads.
Ah yes, threads! it was too late in the evening :)
from c11threads.
the win32 API doesn't have a condvar-equivalent construct
Mesa has a header-only implementation [1] and it uses the Win32 functions for condition variables.
[1] https://gitlab.freedesktop.org/mesa/mesa/-/blob/22.1/include/c11/threads_win32.h
from c11threads.
Nice, I guess they added condition variables to win32 at some point. It was later than the last time I had to deal with win32 programming though. It's only available on windows vista and later.
Nevertheless, that sounds like a good candidate for a windows port of c11threads. So as I said previously, if anyone cares to contribute a windows implementation of all this, I'll be glad to review any pull requests or patches.
from c11threads.
Pull request #21 adding support for win32 has been merged.
from c11threads.
Related Issues (14)
- thrd_detach is spelled incorrectly HOT 1
- gcc timespec_get build error HOT 2
- Trap deadlocks
- thrd_sleep should return int HOT 1
- warning: cast to pointer from integer HOT 6
- Duplicated declaration of timespec_get() on MacOSX HOT 2
- error: weak declaration of 'thrd_exit' must be public HOT 2
- <stdint.h> HOT 3
- C11THREADS_TIMEDLOCK_POLL_INTERVAL not defined HOT 1
- Test failure on FreeBSD HOT 5
- CI HOT 1
- PTHREAD_MUTEX_TIMED_NP Isn't available outside of linux. HOT 6
- Use feature test macro for transparent drop-in HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c11threads.