Short post on safely interacting with an IDB when multi-threading IDAPython scripts: http://williballenthin.com/blog/2015/09/04/idapython-synchronization-decorator/

@williballenthin