Welcome! You may find this topic from a few weeks ago relevant, particularly with regards to multithreading: