Hi,
I have a python script that launches multiple threads. "Everything" client is running, and each thread calls this client to make queries for files / folders specific to that thread.
Will this setup work such that each thread gets its own results from "everything"? Or should I just limit this to 1 thread, and call it multiple times?
Thanks,
Sandip
Python multi-threading
Re: Python multi-threading
The Everything SDK/IPC is currently designed for 1 thread.
Everything will only perform one query at a time.
Executing a query will block until the any other query from another thread completes.
A single Everything query will use all available CPUs.
Everything will only perform one query at a time.
Executing a query will block until the any other query from another thread completes.
A single Everything query will use all available CPUs.
It's up to you, I would leave it threaded for now as I may add support for multiple queries in a future release.Will this setup work such that each thread gets its own results from "everything"? Or should I just limit this to 1 thread, and call it multiple times?
Re: Python multi-threading
Hi,
Thanks for the response.
I have left it as single threaded, since, with multi-threading, I was getting weird responses.
My code (Python) is -
search_for = r'%s folder: child:StoryBoard_*.txt' % (self._src_dir.upper().replace(r'U:', r'T:\RUNDATA'))
essentially, it should return a folder name to me if it contains a file StoryBoard*.txt
Single threaded, for two sample folders, it returns a value of "20" and "992" ... and each of those folders can be listed.
But for 2 threads, it returns 20 folders that can be listed, and the other 992 and all "" (blanks).
let me know if you want to debug this further, else I am ok with the solution as it is for now.
Sandip
Thanks for the response.
I have left it as single threaded, since, with multi-threading, I was getting weird responses.
My code (Python) is -
search_for = r'%s folder: child:StoryBoard_*.txt' % (self._src_dir.upper().replace(r'U:', r'T:\RUNDATA'))
essentially, it should return a folder name to me if it contains a file StoryBoard*.txt
Single threaded, for two sample folders, it returns a value of "20" and "992" ... and each of those folders can be listed.
But for 2 threads, it returns 20 folders that can be listed, and the other 992 and all "" (blanks).
let me know if you want to debug this further, else I am ok with the solution as it is for now.
Sandip