Hello,
2011/3/18 <richardcavell(a)mail.com>om>:
Does anyone have any ideas about how to implement
multithreading in a
Wikipedia bot in a robust way?
Do you absolutely need to have several threads communicating with Wikipedia?
My first simple idea here would involve a single thread handling the
communication, and as many worker threads as needed for processing.
When a worker is done with its task, it exchanges with the
master/communication guru thread: give previous payload's results, get
next payload.
Because only a single thread communicates with Wikipedia, the
tokens/rate control/authentication/error handling/etc... is simpler to
handle.
Would that work for you?
I think that the "best" design really depends on the kind of tasks you
are working for.
Regards,
--
Nicolas Dumazet — NicDumZ