This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to make user-defined functions abortable



I have a small set of C functions that I have hooked into
Guile. Unfortunately, they allocate lots of memory and take a long
time to execute, and there are times when it would be nice to do C-c
and abort the execution. Due to the allocated memory, I need to
protect the functions in SCM_DEFER_INTS/SCM_ALLOW_INTS which blocks
the possibility of using C-c. 

Can I safely set up a signal handler to catch SIGABRT and deallocate
the memory that I have claimed? I am quite inexperienced in signal
handling unfortunately, so I do not entirely understand the issues
here. Is there a simple method using libguile to do this? I am
thinking of the Guile primitives catch/throw.

	Best regards,
	Lars

-- 
Lars Arvestad               Dept. of Numerical Analysis and Computing Science
                       Royal Institute of Technology (KTH), Stockholm, Sweden

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]