Skip to content

avoid sucking down a cpu when input pipe closes#15

Open
dickmao wants to merge 1 commit into
riga:masterfrom
dickmao:dev
Open

avoid sucking down a cpu when input pipe closes#15
dickmao wants to merge 1 commit into
riga:masterfrom
dickmao:dev

Conversation

@dickmao

@dickmao dickmao commented May 23, 2024

Copy link
Copy Markdown
python - <<EOF
from time import sleep
import jsonrpyc; from subprocess import Popen, PIPE
p=Popen(["sleep", "120"], stdin=PIPE, stdout=PIPE)
rpc = jsonrpyc.RPC(stdin=p.stdout)
p.kill()
while rpc.watchdog.is_alive():
  sleep(1)
EOF

Now look at the processes on your machine. At least on my Linux system, I see the python suck down a core.

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

Successfully merging this pull request may close these issues.

1 participant