JuliaPy / JuliaPy/PythonCall.jl

reducing allocations when checking python coroutines

Aperta
#283 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
1.1k
Fork
86
Merge medio
1g 22h
PR unite (30g)
3

Descrizione

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?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.