| View previous topic :: View next topic |
| Author |
Message |
Derek8588
Joined: 22 Oct 2004 Posts: 62
|
Posted: Tue Jan 15, 2008 12:52 am Post subject: Running Multiple Threads Help |
|
|
I have searched around MSDN and the forums here, but I can't figure this out.
I have a program start, create multiple threads with the same priority, and everything goes well. My goal was to have one of these threads halt until I pressed a key on my keyboard. This thread communicates with my EE SIO cable and hyperterminal on my PC. The problem is, when my thread calls sio_getc(); in a while loop, it halts all of my other threads and main(); I know that SIOSHELL in the SVN idles in the background of the PS2 until the Enter key is pressed on the PC keyboard. It then takes control. When you type exit, it resumes control to the OS of the PS2. How could I set up this thread to do the same thing, without causing all of my other threads to halt? ANy help is appreciated. Thanks |
|
| Back to top |
|
 |
EEUG
Joined: 13 May 2005 Posts: 136 Location: The Netherlands
|
Posted: Tue Jan 15, 2008 3:45 am Post subject: |
|
|
...most probably you have your code like this: | Code: |
while ( ( chr = sio_getc () ) < 0 );
|
try to change it to this:
| Code: |
while ( ( chr = sio_getc () ) < 0 ) RotateThreadReadyQueue ( <priority of your threads> );
|
|
|
| Back to top |
|
 |
Derek8588
Joined: 22 Oct 2004 Posts: 62
|
Posted: Wed Jan 16, 2008 5:15 am Post subject: |
|
|
| Wow, that works beautifully. Thank you so much. Such a simple solution. |
|
| Back to top |
|
 |
Derek8588
Joined: 22 Oct 2004 Posts: 62
|
Posted: Sun Jan 20, 2008 5:22 am Post subject: Keeping em alive |
|
|
| I have been tinkering around with threads and can run multiple threads that do different things with no problem. How can I create a thread that runs within kernel memory, so when user memory is reset, it will continue to run? Thx |
|
| Back to top |
|
 |
misfire
Joined: 06 Sep 2004 Posts: 120 Location: Germany
|
|
| Back to top |
|
 |
|