Original Post
Hi all, I have a program that polls DirectInput for update information. However, when running a server in the background that competes for CPU power (50% my program, 50% server), the mouse drags in responsiveness. This is obviously due to the fact that the polling mechanism is not being called often enough from the main loop. Now, my computer isn't the fastest of them, but there are definitely slower ones, so I decided that it would be good to create a separate thread to poll DirectInput on to make my input FPS independent. Now, I just finished debugging a multithreaded OpenGL nightmare with contexts and all that fun stuff, and I am not particularly interested in doing this with DirectInput. So, does anyone happen to know what DirectInput's threading policy is. Here are 3 possible situations, I am leaning toward #3, since it best suites my needs. Situation 1: Thread A: Initializes DirectInput, Reads thread shared variable via mutex Thread B: Polls DirectInput, updates shared variable via mutex Situation 2: Thread A: Creates Thread B and reads shared variables via mutex Thread B: Initializes, pools, and updates variables via mutex Situation 3: Thread A: Creates Thread B and reads shared variables via mutex, sometimes calls DI functions from interface created on thread B. Thread B: Initializes, polls, and updates variables via mutex. Anyone have any war stories or wisdom to share on this matter?