Sorry for the broad thread title.
Something I've always wondered is how programs like sound drivers do something exactly ____ times a second. In the sound driver's case, probably 44100 times a second. I know there are platform specific sleep functions, but whatever operation is done is going to take time as well, so it's not all as simple as that.
How is this accomplished? One thread for timing and one thread to do the task?
In my case, I'm going to be using an FTDI chip to interface with an older chip and will need to update the registers with microsecond accuracy (1 MHz).
Thanks in advance.