wsdiff could stand to be seriously sped up by doing its comparisons in
parallel:

    6510912 wsdiff should make use of more than 1 CPU

so I've put something together that does just that.  It fires up one thread
for each online CPU on the machine, and each thread pulls from a work queue
until its done.  I need someone to review the changes:

    http://www.comfychair.org/~duvall/webrev-wsdiff-mt/

if you can claim experience with Python threading, that'd be even better.
My threading-fu is weak, and my feel for how it's supposed to work in
Python is pretty limited.

Also, any comments on design would be appreciated.  A couple of notes:

  - I'm not sure if the way I choose the number of threads is appropriate,
    or if there's a better way.

  - I feel like all the queue-termination code is hacky, but I don't know
    of a better way to do it, short of requiring Python 2.5 to bring in
    new Queue module APIs.

  - For some reason, hitting ^C causes the worker threads to throw
    exceptions where I don't expect them, but otherwise I don't see any
    deleterious effects.  MainThread is the only thread that actually sees
    SIGINT, as I would expect; it's just that the other threads don't
    terminate as cleanly as I would expect.  I can't reproduce that in a
    reduced version of the program.

  - Yes, there are a bunch of debugging print statements that will go away.

Thanks,
Danek
_______________________________________________
tools-discuss mailing list
[email protected]

Reply via email to