Giter Club home page Giter Club logo

Comments (8)

jtsiomb avatar jtsiomb commented on June 11, 2024

I might be missing something, but what would networking have to do with a C11 threads implementation?

from c11threads.

jimon avatar jimon commented on June 11, 2024

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.

jimon avatar jimon commented on June 11, 2024

Probably most of stuff could be copy-pasted from here https://github.com/tinycthread/tinycthread with saving license note.

from c11threads.

jtsiomb avatar jtsiomb commented on June 11, 2024

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.

jimon avatar jimon commented on June 11, 2024

Ah yes, threads! it was too late in the evening :)

from c11threads.

oold avatar oold commented on June 11, 2024

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.

jtsiomb avatar jtsiomb commented on June 11, 2024

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.

jtsiomb avatar jtsiomb commented on June 11, 2024

Pull request #21 adding support for win32 has been merged.

from c11threads.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.