[Python-ideas] Speed up os.walk() 5x to 9x by using file attributes from FindFirst/NextFile() and readdir()

random832 at fastmail.us random832 at fastmail.us
Wed Nov 14 20:10:12 CET 2012

On Wed, Nov 14, 2012, at 13:55, Robert Collins wrote:
> I forget the win32 behaviour, but on Linux a thread is a process ->
> chdir is localised to the process and not altered across threads.

This claim needs to be unpacked, to point out where you are right and
where you are wrong:
Linux threads are processes: true.
cwd _can be_ localized to a single [thread] process rather than shared
in the whole [traditional] process: also true.
(see http://linux.die.net/man/2/clone, note specifically the CLONE_FS
cwd _actually is_ localized to a process when created in the ordinary
manner as a thread: false.
(see http://linux.die.net/man/7/pthreads )

More information about the Python-ideas mailing list