Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow killing jobs on Lisp exit (job control?) #2

Open
Ambrevar opened this issue Jan 13, 2021 · 2 comments
Open

Allow killing jobs on Lisp exit (job control?) #2

Ambrevar opened this issue Jan 13, 2021 · 2 comments

Comments

@Ambrevar
Copy link
Contributor

Currently, the following

> (cmd:cmd& "sleep 17")
#<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {100DB4A553}>
("sleep" "17")
> ,quit

leaves the "sleep" process hanging in the background.
It's particularly inconvenient if the process happens to consume a lot of CPU.

Job control can be complicated to implement, so maybe it's out of the scope of this library. Any idea if a Common Lisp job control library already exists?

That said, we could leverage the shell to do job control.
For instance, the following will kill the sleep process when Lisp is exited:

 (uiop:launch-program "set -o monitor; sleep 17 & read dummy; kill %1" :input :stream)

The workaround has the benefit of being easy to implement (just need to make sure the command is passed properly to the same).
The downside is that it runs a shell process for each launch-program.

Maybe make it (global) option of cmd?
Thoughts?

@ruricolist
Copy link
Owner

So far I've limited cmd to functionality that is available on Windows as well as Unix. Do you know of a Windows equivalent?

@Ambrevar
Copy link
Contributor Author

Ambrevar commented Jan 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants