The mailbox API is incomplete

Не Скажу dondebedall at mail.ru
Wed Mar 13 19:50:12 UTC 2019


Hello!

The mailbox API is incomplete, lacking timeout option.

I don't know whether there is a common standard for it, but according to this - http://cl-cookbook.sourceforge.net/process.html at least LispWorks has such feature.

Having timeout would be a really useful, consider this scenario:

1) Main thread continuously passes some data to ECL thread, waiting for ECL thread to process it.
2) ECL thread processes this data and returns it back to main thread;
3) Main thread continues execution, gathers new data, etc.

Main thread --> ECL thread --> Main thread

User is given full control over ECL thread, being able to change anything within it, mainly how data should be processed. What if user makes a mistake and something goes wrong, like:

1) Debugger is entered;
2) User input is requested;
3) An infinite loop is created.

That would mean that execution of ECL thread is halted, halting execution of main thread in return. Program is stuck.

A timeout would save from such situation: after x number of milliseconds passed execution would go back to the main thread and program wold not freeze. Main thread would know that something went wrong within ECL thread and could skip it next time until it receives notification that whatever problems had arisen in ECL thread were fixed.

Sure, ignore-errors could be used to prevent debugger from breaking execution, but it would be much better to still being able to use it. Besides, ignore-errors will not save from problems 2 and 3 mentioned above.







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20190313/95375153/attachment.html>


More information about the ecl-devel mailing list