Re: [AD] Mini-synchronization API proposal for 4.1.x

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2002-03-23, Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
> Take 2 is attached. I got rid of the 'locked' field and finally reverted to
> my first idea, i.e using an API similar to both Win32-threads and Pthreads
> because:
> - for once the two worlds agree, let's try not to create a third one,
> - the implementation is lighter, with one less indirection level,
> - less prone to heap memory corruption.
> 
> Compiled under DJGPP and Mingw32.

Does `count' need to be in the platform-wide structure?  Not that it
matters.

I'll send a pthreads implementation soon.  But, are AL_MUTEXes only
designed to be used (by the user) between callbacks and the main
thread?  The reason I ask is because of this in the glibc manual:

   It is not safe to call mutex functions from a signal handler.  In
   particular, calling `pthread_mutex_lock' or `pthread_mutex_unlock'
   from a signal handler may deadlock the calling thread.


Also, if you disable threads in the Unix port and use SIGALRM instead,
should:

(a) AL_MUTEXes do nothing (because callbacks are then "atomic", so no
	synchronisation required)

(b) AL_MUTEXes do ... something else?

I guess (a).



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/