Re: deque and thread-safety

2012-10-13 Thread Dieter Maurer
Christophe Vandeplas christo...@vandeplas.com writes: ... From the documentation I understand that deques are thread-safe: Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory efficient

deque and thread-safety

2012-10-12 Thread Christophe Vandeplas
Hello, I have a question about deque and thread-safety. My application has multiple threads running concurrently and doing the same action (downloading pages) To know what has already been downloaded I created the variable: seen = deque('', 1000) (keeps list of max 1000 urls in memory

Re: deque and thread-safety

2012-10-12 Thread Christophe Vandeplas
Ok sorry for the mail, I found the solution by using deque.count(url) that's available starting from python 2.7 On Fri, Oct 12, 2012 at 2:40 PM, Christophe Vandeplas christo...@vandeplas.com wrote: Hello, I have a question about deque and thread-safety. My application has multiple threads

Re: deque and thread-safety

2012-10-12 Thread Antoine Pitrou
Hello, Christophe Vandeplas christophe at vandeplas.com writes: From the documentation I understand that deques are thread-safe: Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory