Opened 11 days ago

Last modified 10 days ago

#17521 new enhancement

Add C11 Thread support (easy)

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/beta3
Keywords: C11 Cc:
Blocked By: Blocking:
Platform: All


Mesa was asking about us getting C11 threads. From what I can tell we don't offer this today.

C11 Threads    POSIX Threads
thrd_create()  pthread_create()
thrd_current() pthread_self()
thrd_detach()  pthread_detach()
thrd_equal()   pthread_equal()
thrd_exit()    pthread_exit()
thrd_join()    pthread_join()

Today we offer BeOS native things like thread_id find_thread(const char *name); , and POSIX threads like pthread_t pthread_self(void);

Change History (9)

comment:1 by tqh, 11 days ago

I guess there are some types as well?

comment:2 by kallisti5, 11 days ago

probably :-)

Getting the C11 Standard
C11 and C++11 are available from the ANSI store.  For C11, use this link:‐2012.  For C++11, use this
link:‐2012 .  Each costs
$30 USD for PDF. The whole process takes only a few minutes.


comment:3 by tqh, 11 days ago

Lets not buy it, we kind of do like challenges :)

comment:4 by kallisti5, 11 days ago

lol. we definitely should reverse engineer something that only costs $30

comment:7 by pulkomandy, 10 days ago

Apparently this does not require anything specific in GCC, so we should be able to copy an implementation from a C library as we usually do (glibc 2.28 or later, or *BSD or musl).

musl has some thrd_* things: , it seems to call into musl internals directly FreeBSD docs: says they implement it as "a thin wrapper over pthreds" so that may be easy to reuse

comment:8 by pulkomandy, 10 days ago

It looks like we just need this one file from FreeBSD:

Last edited 10 days ago by pulkomandy (previous) (diff)

comment:9 by pulkomandy, 10 days ago

Summary: Add C11 Thread supportAdd C11 Thread support (easy)
Note: See TracTickets for help on using tickets.