Re: [AD] mzscheme bindings in svn

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


On 2007-04-28, Jon Rafkind <workmin@xxxxxxxxxx> wrote:
> >>>      
> >>That would be fine (but call it __al_xwin_dont_install_signal_handlers
> >>or something).  A dirtier solution would be to save the MzScheme signal
> >>handlers before calling allegro_init(), then restore them immediately
> >>afterwards.  This would work with current and older versions of Allegro.
> >>
> >>  
> >>    
> >I think messing with the invariants about the garbage collector is 
> >tricky business and might lead to very strange results.

I don't think it's that tricky.  During the short time that Allegro is
initialising we wouldn't be writing to any pages which MzScheme has
marked as read-only (I'm assuming that's how it works) and we'd restore
it straight after.  Disabling *all* of Allegro's emergency signal
handlers seems overkill.

> I'd rather use 
> >the _al_xwin_install_signal_handlers way.
> >  
> >
> Attached is a patch that more or less does this. Calling 
> enable_signal_handlers/disable_signal_handlers() will result in calling 
> enable_signals() for each driver listed in the system_list if 
> system_driver has not been initialized, otherwise it just calls 
> system_driver->enable_signals(). This is done because you need to 
> enable/disable signal handlers before the system driver init() method is 
> called so there is no way to know which system driver is being used 
> until allegro_init() finds the right driver.

We definitely don't want to be adding to the namespace pollution with
enable_signal_handlers().  It doesn't need to be part of the official
API.  I think an internal global variable is enough for this anyway.

> The only thing really missing is the sigalarm stuff in the bg_manager in 
> src/unix. I'm not totally sure what to do about that. I don't think it 
> affects my problem directly but if disable_signal_handlers() does what 
> it says its supposed to it shouldnt use SIGALRM. Maybe it can just 
> default to use the pthread bg_manager and it is an error for the user to 
> disable signals and not have the capability to use pthreads.

Just name the variable properly:

    int __al_dont_install_emergency_signal_handlers;

> Does the sourceforge compile farm work for Allegro? There might be a few 
> small errors here and there on systems I didn't test( dos, beos, qnx, 
> macosx ).

We've certainly used the compile farm to test things in the past.

Peter

PS. Please be more careful with formatting, otherwise we just need to
waste time fixing it up before committing.





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