[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] force-primordial - dunno what to do
From: |
Jörg F . Wittenberger |
Subject: |
[Chicken-hackers] force-primordial - dunno what to do |
Date: |
Sun, 14 Feb 2016 19:35:12 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0 |
Hi,
chickens leaves me with a segfault every now and then. Turned out this
is dues to:
(dbg "select(2)/poll(2) returned with result -1" )
(##sys#force-primordial)
in ##sys#unblock-threads-for-i/o
I did not yet understand how this comes to produce a segfault.
Less I understand why the primordial should be special (i.e. required
special care from the app programmer) to expect sudden unblocks when
other threads don't. (some code could be simpler if it had not to
handle this case)
Even less I understood what the primordial is actually supposed to do at
this point.
As it looked completely useless to me I decided to try a modified
##sys#force-primordial like this:
(define (##sys#force-primordial)
(dbg2 "primordial thread forced due to interrupt\n")
;;;; (##sys#setislot ##sys#primordial-thread 13 #f)
;;;; (##sys#thread-unblock! ##sys#primordial-thread)
)
Which is I simply made it always log the call to stderr but not do
actually anything to the primordial. ("dbg2" is a copy of the commented
out version of "dbg" in scheduler.scm.)
The effect:
a) no damage. Threading working, signals working, tests passing.
b) segfault gone
Has anybody any knowledge when this is actually required?
Thanks
/Jörg
- [Chicken-hackers] force-primordial - dunno what to do,
Jörg F . Wittenberger <=