atlas-engineer / ndebug

A Common Lisp toolkit to construct interface-aware yet standard-compliant debugger hooks.
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Removing lparallel dep #2

Closed Ambrevar closed 2 years ago

Ambrevar commented 2 years ago

Indeed, depending on Lparallel for library has some drawbacks, namely the kernel instantiation!

One way to do this properly is to wrap the lparallel calls in (let ((lparallel:*kernel* MY-KERNEL)) ...), with MY-KERNEL being something you initialize for instance with condition-wrapper.

But really we barely need Lparallel here, as far as I can tell it's only used to pass one restart. To replace Lparallel with BT, you can replace (lparallel:receive-result channel) with bt:condition-wait. Instead of one channel slot, you'll need 2 slots: one for the bt:condition, one of the value.

aartaka commented 2 years ago

Yes, conditions or semaphores both could work here. It's just that Lparallel looked a bit prettier to me in terms of using it for prototyping. But now, yes, Bordeaux Threads are a good way to move forward!