POSIX semaphores in newlib-based toolchains

33 views
Skip to first unread message

Jakub Zalewski

unread,
Jul 2, 2015, 4:12:35 PM7/2/15
to native-cli...@googlegroups.com
Dear all,
I am working on porting GHC's runtime system to clang-nacl, and the runtime system depends on posix semaphores (an extension to posix threads).

Are there any plans to add posix semaphores to newlib-based toolchains?

Best wishes,
Jakub

Ben Smith

unread,
Jul 2, 2015, 5:38:05 PM7/2/15
to native-cli...@googlegroups.com
semaphore.h is included in the newlib toolchains, though it looks lime sem_timedwait is missing.

Victor Khimenko

unread,
Jul 2, 2015, 5:38:30 PM7/2/15
to Native Client Discuss, Sam Clegg
AFAIK there are no such plans but if you'll create appropriate patches then they could be accepted. Threading primitives in newlib and not very efficient and there were talks about improving them, but nothing was every implemented AFAIK.

I think that it's good idea to do that at some point but as short-term solution you could just grab bionic implementation of semaphores and use that:

Futexes are implemented by IRT, if there are some deficiency we could fix/extend them.

Victor Khimenko

unread,
Jul 2, 2015, 5:42:31 PM7/2/15
to Native Client Discuss
On Fri, Jul 3, 2015 at 12:38 AM, Ben Smith <bi...@chromium.org> wrote:
semaphore.h is included in the newlib toolchains, though it looks lime sem_timedwait is missing.


Oops. Looks like newlib is significantly more complete now. Do you have any idea why sem_timedwait was not implemented? It does not look like it's harder to implement than sem_wait...
 
On Thursday, July 2, 2015 at 1:12:35 PM UTC-7, Jakub Zalewski wrote:
Dear all,
I am working on porting GHC's runtime system to clang-nacl, and the runtime system depends on posix semaphores (an extension to posix threads).

Are there any plans to add posix semaphores to newlib-based toolchains?

Best wishes,
Jakub

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages