Summary
mailbox timeouts and thread signaling
Metadata
- Id: 100f5e41c77929d53935feb6e3e8c4cd6cbb66ba
- Trac id: 1372
- Type: defect
- Reporter: caolan
- Owner: kon
- Cc:
- Status: assigned
- Component: extensions
- Estimated difficulty:
- Resolution:
- Priority: major
- Milestone: someday
- Version: 4.12.0
- Changetime: 2017-08-25 16:56:34 UTC
- Created: 2017-05-23 11:31:33 UTC
- Keywords: mailbox
Description
There appears to be a scheduler problem in the mailbox egg. If I signal a thread waiting on mailbox-receive! with a timeout, the program hangs and csi eats all my cpu.
(use srfi-18 mailbox)
(define mbox (make-mailbox))
(define primordial (current-thread))
(define t (thread-start! (lambda ()
(thread-sleep! 1)
(thread-signal! primordial 'example))))
;; this hangs forever and eats all my cycles (with timeout)
(print (mailbox-receive! mbox 4))
;; this exits as expected with the 'example exception (no timeout)
(print (mailbox-receive! mbox))
Changes and comments
[2017-08-25 15:09:43 UTC] sjamaan changed status from new to assigned
[2017-08-25 15:09:43 UTC] sjamaan set owner to kon
[2017-08-25 15:09:43 UTC] sjamaan wrote:
I also noticed that mailbox fails to install right now...
[2017-08-25 16:56:34 UTC] kon wrote:
The above sleeps the primodial thread. When no threads other than the primodial thread ('t' above not started) the primodial times-out. But w/ another thread to run the primodial is never timed-out; I need to look in the scheduler, sounds not right.
Suggest not doing a 'mailbox-receive!' while running as the primodial, at least for now.
Ex: 'reader-writer-test' uses a separate reader & writer threads.