From: Lawrence S. <ljs...@us...> - 2016-01-27 14:49:20
|
POSIX semaphores are a bit different than KOS semaphores for a couple of reasons. Chief amongst them is that POSIX semaphores can be used for cross-process synchronization, which is obviously inapplicable in KOS as we have no concept of processes. Also POSIX semaphores are often (but not required to be) implemented as files in the filesystem, which is pretty helpful in implementing their cross-process support. I’d recommend just porting the threading stuff over to KOS threads wholesale if you’re porting SDL2 rather than trying to use the pthreads stuff. It shouldn’t be hard to port it properly, plus then you have less overhead to deal with (since the pthreads stuff just calls down to the KOS stuff anyway). Also, I haven’t really been paying any attention to the pthreads stuff for a while… - Lawrence > On Jan 27, 2016, at 5:14 AM, Luke Benstead <ka...@gm...> wrote: > > Hi, > > I've tentatively started porting SDL 2 to KOS - I have it successfully compiling, I've just started swapping out all the generic/dummy implementations of the subsystems with KOS specific ones. I've done the timer backend and now I'm working on the thread backend. > > I noticed that the existing pthreads backend in SDL 2 would probably work on KOS, but SDL looks for "semaphore.h" which apparently doesn't exist in KOS, but does exist in newlib. There also seems to be a very similar semaphore implementation in "kos/sem.h". > > Before I implement a wrapper around kos/sem.h to make the SDL 2 pthreads stuff compile, I just wondered if there was a reason why semaphore.h isn't available in KOS by default, and would it be better if I perhaps altered the semaphore.h from newlib (in a similar way to pthread.h) and sent a patch to KOS? > > Thanks, > > Luke. > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > cadcdev-kallistios mailing list > cad...@li... > https://lists.sourceforge.net/lists/listinfo/cadcdev-kallistios |