HI Jorge,

> OK, if I understood 'task' correctly this runs entirely on the 'main'
> process (the one that will be accessing the database and queueing the
> commands).


> Looks like if the main process is busy in a very CPU-intensive task
> (no IO at all) it could be missing some chances to launch additional
> processes, but I guess I can workaround that inserting a (wait 0) at
> some point in the expensive calculation to give the task a chance to
> run, right?

Yes. Besides during 'wait', the background tasks also run when 'dbSync',
'key' or 'listen' are executed. From these, 'key' is perhaps useful
here, calling (key 0) to check for a key press without delay.

Another possibility is to write an explicit 'job' (e.g. with 'curry') or
a coroutine, and call that both in the background task and in the CPU
intensive code.

- Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to