title: Threading in C with CreateThread()
body: <p>I am very much a novice to C, and I am trying to make a program to run MIDI sequences, and basically, I have two functions, both running a different MIDI pattern, and I need them to run in parallel. Due to the nature of the functions (one running a sequence and the other playing random notes), I am almost 100% sure that I can't have then running in the same function.</p>
  
  <p>I've been scouring the internet for some clue on how to do this with pthreads (which apparently don't work on Windows?) and CreateThread(), but I can't seem to get it to work. I am currently trying to use CreateThread() and trying to bring in the integers required for the random midi sequence and I am getting an error concerning 'LPTHREAD_START_ROUTINE' which reads: 'expected 'LPTHREAD_START_ROUTINE' but argument is of type 'DWORD (*)(int, int, int)'.</p>
  
  <p>A sort of pseudocode of what I'm working on is here:</p>
  
  <pre><code>DWORD WINAPI solo_thread(int key, int tempo, int scale)
  {
                    ///// this contains the random midi notes
  }
  int backing(int key, int tempo, int backing)
  {
      HANDLE thread = CreateThread(NULL, 0, solo_thread, NULL, 0, NULL);
      if (thread) {
                   ////// this contains the midi sequence
  
  }
  </code></pre>
  
  <p>Hopefully I have explained my problem well... But I am well aware that the most likely case is that I am going about this CreateThread() thing in all the wrong ways. </p>
  
  <p>Thanks!</p>