pd and Gem and multithreading