JuliaPy / JuliaPy/PythonCall.jl
reducing allocations when checking python coroutines
Abierto
- Lenguaje dominante
- Julia
- Estrellas
- 1.1k
- Forks
- 86
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 3
Descripción
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?
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.