Code Monkey home page Code Monkey logo

Comments (4)

willghatch avatar willghatch commented on May 30, 2024

My plan at this point is to have unix-style job control for pipelines consisting only of subprocess, and punt job control for other things to a future time.

Job control involving Racket code really wants to be thread-based, and would just use threads except that various bits of state are thread-local. For example, cd changes the current-directory parameter, but if it's run in a different thread then it won't change anything outside of that thread since parameters are thread-local. If there were a way to get the state out of a completed thread, I think that is how I would want to do job control for Racket commands -- run in a thread, and then when the foreground thread finishes update the REPL thread with the state from the done foreground thread.

from racket-rash.

willghatch avatar willghatch commented on May 30, 2024

Another new embedded lisp shell Janetsh has job control working, so perhaps I should see what series of syscalls it's using and how it differs from my job-control branch. It's likely to have cleaner code there than Bash and Zsh, which I was looking at when I was trying to implement it.

from racket-rash.

willghatch avatar willghatch commented on May 30, 2024

I made some progress on this today. One major problem from the last time I tried it is that there is some initialization that the shell must do that I didn't know about. Now that's working. The biggest problem now is what to do about Racket using SIGCHLD, which notifies a parent when a child exits OR stops (I think). Anyway, I can wait for the subprocess to exit with Racket, but I also need to be able to wait on subprocesses stopping, eg. when they get SIGTSTP, so the shell can resume with the job backgrounded. If I can figure out how to do that, then it should be pretty easy to get my code otherwise working.

from racket-rash.

willghatch avatar willghatch commented on May 30, 2024

Well, I'm not so sure about using SIGCHLD, but I think waitpid is the right way to do this. But Racket uses waitpid as well, perhaps I need to figure out what it's doing and see if it conflicts with what I'm trying to do...

from racket-rash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.