Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-18 Thread Jörg F . Wittenberger
Thanks Evan. Am 18.01.2016 um 03:59 schrieb Evan Hanson: > On 2016-01-15 11:31, Jörg F. Wittenberger wrote: >> I would not be surprised if an innocent reader would read the code >> with the comment missing and conclude that we save the local variable >> `stack_limit` and simply assign

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-17 Thread Evan Hanson
On 2016-01-15 11:31, Jörg F. Wittenberger wrote: > I would not be surprised if an innocent reader would read the code > with the comment missing and conclude that we save the local variable > `stack_limit` and simply assign C_stack_limit to `saved_stack_limit`, > which would bring the bug back.

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-15 Thread Jörg F . Wittenberger
Sorry for replying to my own message. Am 14.01.2016 um 22:18 schrieb Jörg F. Wittenberger: > Great that this made it so far. > > Am 14.01.2016 um 20:20 schrieb Peter Bex: >> On Fri, Jan 15, 2016 at 12:59:28AM +1300, Evan Hanson wrote: >>> Hi all, >>> >>> Attached is a signed-off copy of this

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-14 Thread Evan Hanson
Hi all, Attached is a signed-off copy of this patch, with some of the info in the comments moved into the commit message. It won't change anything in the normal, single-threaded case, and it can only improve behaviour in multi-threaded programs, so it's fine with me. Thanks, Jörg, for

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-14 Thread Evan Hanson
On 2016-01-14 22:18, Jörg F. Wittenberger wrote: > I tried to strike a balance between doing the right thing (and produce a > huge unintelligible overkill) and getting something acceptable done. Yeah, I think this was a good change on its own as it'll make the problem far less likely (though of

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-14 Thread Jörg F . Wittenberger
Great that this made it so far. Am 14.01.2016 um 20:20 schrieb Peter Bex: > On Fri, Jan 15, 2016 at 12:59:28AM +1300, Evan Hanson wrote: >> Hi all, >> >> Attached is a signed-off copy of this patch, with some of the info in >> the comments moved into the commit message. Actually I'm slightly

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2016-01-14 Thread Peter Bex
On Fri, Jan 15, 2016 at 12:59:28AM +1300, Evan Hanson wrote: > Hi all, > > Attached is a signed-off copy of this patch, with some of the info in > the comments moved into the commit message. It won't change anything in > the normal, single-threaded case, and it can only improve behaviour in >

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-03 Thread Jörg F . Wittenberger
;-) as promised: Am 02.12.2015 um 14:57 schrieb Jörg F. Wittenberger: > No more patches today. This again is no good > because it allocates a slot in pending_interrupts, but doesn't - and > can't deallocate it. No more patches yesterday. This one sustained the test to sleep one night over it.

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-03 Thread Jörg F . Wittenberger
Am 03.12.2015 um 14:01 schrieb John Cowan: > Jörg F. Wittenberger scripsit: > >> One more question. I would have expected chicken to store signals >> received while C_interrupts_enabled==0 and deliver them at some point >> after C_interrupts_enabled becomes true. Why are those signals ignored?

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-03 Thread John Cowan
Jörg F. Wittenberger scripsit: > One more question. I would have expected chicken to store signals > received while C_interrupts_enabled==0 and deliver them at some point > after C_interrupts_enabled becomes true. Why are those signals ignored? That's what signal blocking is supposed to be

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-02 Thread Jörg F . Wittenberger
Hi all, I guess I must apologize for first posting an almost good patch and then once I found this cut error, I became confused and made a mess out of it. Am 30.11.2015 um 12:44 schrieb Jörg F. Wittenberger: > Am 29.11.2015 um 17:55 schrieb Jörg F. Wittenberger: >> Am 26.11.2015 um 11:29 schrieb

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-02 Thread Jörg F . Wittenberger
Sadly there is always room to make things better. The last version would require the conditional expression to be atomic, not only the ++ operator. Better we reset the signal counter to it's maximum if it went over the fence during increment. Version attached. Am 02.12.2015 um 13:52 schrieb

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-02 Thread Jörg F . Wittenberger
Argh, this is still no good. Now the pending_interrupts_count will grow beyond bounds. Use the attached version instead. Sorry. /Jörg Am 02.12.2015 um 13:28 schrieb Jörg F. Wittenberger: > Hi all, > > I guess I must apologize for first posting an almost good patch and then > once I found

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-12-02 Thread Jörg F . Wittenberger
I don't believe it. No more patches today. This again is no good because it allocates a slot in pending_interrupts, but doesn't - and can't deallocate it. Maybe tracking saved_stack_limit as in my second patch is actually the simpler change. Am 02.12.2015 um 14:05 schrieb Jörg F. Wittenberger:

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-11-30 Thread Jörg F . Wittenberger
Attached a better version. Am 30.11.2015 um 12:44 schrieb Jörg F. Wittenberger: > Am 29.11.2015 um 17:55 schrieb Jörg F. Wittenberger: >> Am 26.11.2015 um 11:29 schrieb Jörg F. Wittenberger: >> The signal handler in the other thread will happily set the global >> variable C_stack_limit to point

[Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-11-30 Thread Jörg F . Wittenberger
Am 29.11.2015 um 17:55 schrieb Jörg F. Wittenberger: > Am 26.11.2015 um 11:29 schrieb Jörg F. Wittenberger: > The signal handler in the other thread will happily set the global > variable C_stack_limit to point 1000 word off the stack pointer at the > other thread. Perhaps the attached patch is

Re: [Chicken-hackers] PATCH: allow signal handlers to be called from any thread.

2015-11-30 Thread Jörg F . Wittenberger
Wait, this patch has a bug. Sorry. Am 30.11.2015 um 12:44 schrieb Jörg F. Wittenberger: > Am 29.11.2015 um 17:55 schrieb Jörg F. Wittenberger: >> Am 26.11.2015 um 11:29 schrieb Jörg F. Wittenberger: >> The signal handler in the other thread will happily set the global >> variable C_stack_limit