JuliaPy / JuliaPy/PythonCall.jl

reducing allocations when checking python coroutines

Open
#283 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
1.1k
Forks
86
Avg merge
1d 22h
Merged PRs (30d)
3

Description

If I do:
```julia
while !Bool(fut.done())
sleep(0.01)
end
```
where `fut` is a future created like:
```julia
aio = pyimport("asyncio")
coro = aio.sleep(1)
loop = aio.Runner().get_loop()
aio.run_coroutine_threadsafe(coro, loop)
```
It allocates linearly the more you sleep.
I tried using a global julia vector `[true]` and updating it in place when the future is done, but it doesn't reduce allocations that much, is there a better way?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.