Reworked the research importers to offload the i/o portion of the import to a configurable number of threads.
Note: Due to the way the importers work, I didn't feel the need to implement locking mechanisms on the db reads/writes, as we shouldn't be coming across race conditions that matter. In all cases, it should be perfectly fine if the operations occur in any particular order, and last write can win. I did implement a mt_lock (main thread lock) for reading and writing back to resources on the main thread, and this is working well for avoid strange UI behavior caused by race conditions.
Enhancements:
Note: Due to the way the importers work, I didn't feel the need to implement locking mechanisms on the db reads/writes, as we shouldn't be coming across race conditions that matter. In all cases, it should be perfectly fine if the operations occur in any particular order, and last write can win. I did implement a
mt_lock
(main thread lock) for reading and writing back to resources on the main thread, and this is working well for avoid strange UI behavior caused by race conditions.