spall
2017-3-29 18:42:34

@mflatt Can you explain this to me? ;; FIXME: When Racket's "green" threads are implemented, ;; this lock acquire will need to cooperate, so that other ;; green therads can run if the lock cannot be acquired (define (lock-acquire lock) (mutex-acquire lock))


mflatt
2017-3-29 18:44:32

Racket’s thread will not be the same as Chez’s thread; instead, it will be more like Chez’s engines


mflatt
2017-3-29 18:45:08

When a Racket thread is blocked on a lock, then other Racket threads in the same Chez thread should be able to procede


mflatt
2017-3-29 18:46:40

I’ve just started looking at the implementation of Racket’s thread in terms of continuations and timers


spall
2017-3-29 18:55:29

Okay, yeah I have started on an implementation of racket’s thread on top of chez engines. And am thinking about implementing a scheduler for them (also using engines) but am not sure how engines interact with locks and regular threads


spall
2017-3-29 18:55:52

And htought maybe the cooperative lock concept applied here.


mflatt
2017-3-29 19:03:20

It turns out that there are problems with using Chez engines directly. Notably, dynamic-wind winders are run when an engine pauses and resumes.


mflatt
2017-3-29 19:04:18

I imagined providing a Chez-like engine interface from core and then implementing threads+events+custodians in Racket


spall
2017-3-29 19:04:55

@samth. this probably interests you too


mflatt
2017-3-29 19:04:59

The core would also need to export hooks to support locks, and I’m not sure exactly what that should look like


samth
2017-3-29 19:07:09

The dynamic-wind problem sounds like it would impact a direct use of continuations as well, though


mflatt
2017-3-29 19:07:15

It would be simpler to implement threads+events+custodians in core, but I much prefer writing Racket code, and for the sake of furture portability I’d prefer to implement things in more layers if possible


samth
2017-3-29 19:07:32

But maybe I’m thinking about this incorrectly


mflatt
2017-3-29 19:08:28

@samth Yes, by “continuations” I really mean “metacontinuations” in the new "http://core-control.ss\|core-control.ss", which can easily support a metacontinuation swap that doesn’t run winders


samth
2017-3-29 20:50:05

@mflatt are you in boston already?


mflatt
2017-3-29 20:57:28

No, I’m about to go to the airport


samth
2017-3-29 20:59:51

Ok


samth
2017-3-29 21:00:25

we should talk about coordinating our efforts, but maybe Boston is the best time to do that