Al 04/01/13 22:28, En/na Guido van Rossum ha escrit:
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

Thanks, Guido, for answering. But why can't use threading for poping a list?
My real case is a list of downloaded files that dynamically grows (as user add a file) and also it can lost elements (files which we downloaded).

I was thinking to program concurrently, with futures, but before coding the biggest case, I select the essential (ans smaller) one.

Any specific schema code for doing that?

Thanks,
Xan.


On Fri, Jan 4, 2013 at 11:59 AM, xancorreu <[email protected]> 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
[email protected]
http://mail.python.org/mailman/listinfo/concurrency-sig



_______________________________________________
concurrency-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/concurrency-sig

Reply via email to