I found this xonsh example on a website: sleep 100 & # job 1 sleep 100 & # job 2 sleep…
- User
I found this xonsh example on a website:
sleep 100 & # job 1 sleep 100 & # job 2 sleep 100 & # job 3
while $(jobs): time.sleep(1)
print('Job done!')
Is this the standard way of dealing with parallelism in xonsh? I can't find anything in the documentation recommending a particularly way to handle parallel operations.
Assistant
No – that pattern is the recommended or idiomatic way to run CPU-bound work in parallel in xonsh. It is only a quick-and-dirty trick that works when you want to fire off a handful of commands and then wait for them to finish. It has several drawbacks:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.