Arc Forumnew | comments | leaders | submitlogin
1 point by rntz 5222 days ago | link | parent

That doesn't help if you want to kill a thread which is stuck (or just taking a long time) within an (atomic ...) expression, which seems to me an important use case. Unfortunately the plt doc website appears to be down now, otherwise I'd look into solving it myself.


1 point by akkartik 5222 days ago | link

True, but that sounds like an enhancement to the semantics of atomic (a way to interrupt an atomic operation) rather than a bug in kill-thread.

-----

1 point by aw 5222 days ago | link

There shouldn't be a way to interrupt an atomic operation, because then it won't be atomic.

Your elegant solution to make kill-thread atomic is a good one, if the "killed" thread is in fact guaranteed to be terminated instantly... I'll have to look into it to see if I can find out.

-----

1 point by akkartik 5222 days ago | link

There shouldn't be a way to interrupt an atomic operation, because then it won't be atomic.

An interruptable atomic is basically a transaction that can be rolled back. If it gets interrupted nothing is changed. Probably doesn't make sense to run it from anywhere but kill-thread and similar operations.

To restate my original point: reasonable semantics for atomic are that threads inside atomic can't be killed. How to kill long-running atomics is a separate issue, needing a lot more engineering.

-----

1 point by aw 5222 days ago | link

reasonable semantics for atomic are that threads inside atomic can't be killed

We agree.

-----