RISCfuture/autumn — Issue #38: Problem with thread synchronization
Author: arekanderu
Created: 2011-10-12 15:19:22+00:00
State: open

I have three channels with people on its access list and I am trying to build a global hash with the nicks and their access level from all three channels. In addition, for each nickname i am doing a nickserv glist NICK which returns the grouped nicks for that nickname and i add those to the global staff list as well.

The problem is that sometimes this works and some times it does not because did_receive_notice is being triggered by the next notice request (since the bot is threaded) and the previous request might hasn't complete yet.

I need a way to make did_receive_notice of a specific leaf to be synchronized with all threads and make each thread wait until the previous one is finished.

Is this possible?

More generally speaking i think this kind of problems should be added in documentation. I find it very difficult to implement various things due to the fact that everything is threaded and I have no way to control the threading whenever I must.