[SOLVED] Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-14 Thread Marcus Alves Grando
Ok. I found the problem. That's because in for i test "if EXIT" and break loop if it's true. In main part i'm wait Queue to be empty and set EXIT after that, with this subdirectories in for loop does not process and program exit. Because that output are not same. Removing "if EXIT" all works f

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Marcus Alves Grando
I make one new version more equally to original version: --code-- #!/usr/bin/python import os, sys, time import glob, random, Queue import threading EXIT = False BRANDS = {} LOCK=threading.Lock() EV=threading.Event() POOL=Queue.Queue(0) NRO_THREADS=20 def walkerr(err): print err class

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 1:06 PM, Marcus Alves Grando <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > Marcus Alves Grando wrote: > > > >> Diez B. Roggisch wrote: > >>> Marcus Alves Grando wrote: > >>> > Hello list, > > I have a strange problem with os.walk and threads in python scrip

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Marcus Alves Grando
Diez B. Roggisch wrote: > Marcus Alves Grando wrote: > >> Diez B. Roggisch wrote: >>> Marcus Alves Grando wrote: >>> Hello list, I have a strange problem with os.walk and threads in python script. I have one script that create some threads and consume Queue. For every valu

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Diez B. Roggisch
Marcus Alves Grando wrote: > Diez B. Roggisch wrote: >> Marcus Alves Grando wrote: >> >>> Hello list, >>> >>> I have a strange problem with os.walk and threads in python script. I >>> have one script that create some threads and consume Queue. For every >>> value in Queue this script run os.walk(

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Marcus Alves Grando
Diez B. Roggisch wrote: > Marcus Alves Grando wrote: > >> Hello list, >> >> I have a strange problem with os.walk and threads in python script. I >> have one script that create some threads and consume Queue. For every >> value in Queue this script run os.walk() and printing root dir. But if i >>

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Diez B. Roggisch
Marcus Alves Grando wrote: > Hello list, > > I have a strange problem with os.walk and threads in python script. I > have one script that create some threads and consume Queue. For every > value in Queue this script run os.walk() and printing root dir. But if i > increase number of threads the re

os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Marcus Alves Grando
Hello list, I have a strange problem with os.walk and threads in python script. I have one script that create some threads and consume Queue. For every value in Queue this script run os.walk() and printing root dir. But if i increase number of threads the result are inconsistent compared with o