Should I use stackless python or threads?

MRAB google at mrabarnett.plus.com
Sat Mar 7 20:08:52 CET 2009


John Nagle wrote:
> Minesh Patel wrote:
>> On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone 
>> <exarkun at divmod.com> wrote:
>>> On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel <minesh at gmail.com> 
>>> wrote:
>>>> I am trying to figure out the best approach to solve this problem:
>>>>
>>>> I want to poll various directories(can be run in the main thread).
>>>> Once I notice a file has been added to any directory, I grab a lock,
>>>> spawn a thread to go perform the necessary actions, and then release
>>>> the lock.
>>> That's not a description of a problem.  That's a description of a 
>>> potential
>>> solution.  What problem are you trying to solve?
>>>
>>
>> I have a build system that is outputting various forms of
>> installations in a particular directory structure, e.g. /pxe-installs,
>> /iso-install, /dd-installs, etc...
> 
>    If this is under Windows, there's a Windows function to monitor a
> directory for changes.  This is far more efficient than polling.
> 
You should be aware, however, that this applies only to Windows folders.
If you want to monitor, say, a shared Mac folder from a Windows PC then
that Windows function will fail and you'll have to fall back to polling.



More information about the Python-list mailing list