Virtualize it. Give every thread a scheduling mechanism. When activated, let any thread do nothing but writing his job into a queue. Let a master thread work himself through the queue.
-- Johannes Ponader 0162/94 64 94 0
Am 19.03.2011 um 22:52 schrieb Platonides platonides@gmail.com:
richardcavell@mail.com wrote:
Hi everyone,
My bot is fully functional. It does a number of things in a loop and sleeps between each item in the loop, then at the end of the loop. Yet, my bot is single-threaded. If it is desirable that some of these items occur more frequently than others, then it seems appropriate to break the task up into multiple threads. Yet, there are a few problems:
Or that you reorder it.
If you have check_spam(); sleep(); fix_typos(); sleep(); welcome_users(); sleep();
And check_spam() should be done more frequently, the easiest way seem to be doing:
check_spam(); sleep(); fix_typos(); sleep(); check_spam(); sleep(); welcome_users(); sleep();
Wikibots-l mailing list Wikibots-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibots-l