Date: Fri, 4 Mar 2016 18:33:24 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: [PATCH] add sched_getcpu On Fri, Mar 04, 2016 at 11:21:49PM +0100, Tomasz Sterna wrote: > W dniu 02.03.2016, śro o godzinie 18∶26 -0500, użytkownik Rich Felker > napisał: > > The only safe way to make your own threads is to refrain from using > > libc at all and do your own syscalls. Even calling syscall() may not > > be safe (on i386/glibc it probably uses the vdso syscall pointer from > > TLS); you really need to use asm to make the syscall. > > I understand. > Thank you for explaining. > > > > Is there a reason "pthreads is not a good way to do it"? > > The thread API I am implementing differs much to pthreads, which > required a lot of glue code translating one API to another and felt > hand wrenching. Are you sure? The only functions you really need to use pthreads are pthread_create and one of either pthread_join or pthread_detach. Beyond that, how you do your synchronization is up to you; the standard functions are convenient but you're free to roll your own in terms of atomics and futex or whatever. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.