[concurrency] futures for pop a list

Guido van Rossum guido at python.org
Fri Jan 4 22:28:59 CET 2013


Hi Xan,

You have simplified what you are trying to accomplish too far. Surely
if it really was about popping from a list you shouldn't be using a
thread pool. What is the real use case you are trying to model here?

--Guido

On Fri, Jan 4, 2013 at 11:59 AM, xancorreu <xancorreu at gmail.com> wrote:
> Hi,
>
> I just want to translate this classic code:
>
> ml = [i for i in range(100)]
>
> while ml:
>     element = ml.pop()
>     print(element)
>
> to futures for running pop asynchronously. I started, but I don't see how to
> do that. This [https://gist.github.com/4455376] is the first attempt, but it
> fails when I put more elements on ml (that is ml is growing).
>
> Any hints?
>
> Thanks in advance,
> Xan.
> _______________________________________________
> concurrency-sig mailing list
> concurrency-sig at python.org
> http://mail.python.org/mailman/listinfo/concurrency-sig



-- 
--Guido van Rossum (python.org/~guido)


More information about the concurrency-sig mailing list