Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Parallel Processes
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Nerdbomb




PostPosted: Wed Nov 01, 2006 10:05 pm   Post subject: Parallel Processes

Um... I'm new so.... please tell me if I did anything wrong or violated any forum rules. But, the problem is that I am currently writing a program that may require parallel processes, which is basically running two subprograms at the same time. Can anyone tell me how to do this? I have tried to use the Process command however "get " will not work in a process so is there some way to make it work? If not, is there an alternative way to make the program able to take in both getch and mouse inputs without having the getch cursor disappear before a keystroke is detected? Hope I made sense, please help, big THANK YOU in advance to whoever posts =).
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Wed Nov 01, 2006 10:10 pm   Post subject: (No subject)

What exactly do you *think* you need parallel threads for? Simply put processes in Turing suck. The only reason you should be using them is for something like a chat program, where there would be communication between a host and client.

Read: Why You Should Avoid Processes

However, if you must....

Procedures, Functions, and Processes
DemonZ




PostPosted: Wed Nov 01, 2006 10:12 pm   Post subject: (No subject)

dont use processes, go to ur turing help file and look up the mouse commands, there is an example there of mouse and keyboard input that u might find useful
Nerdbomb




PostPosted: Wed Nov 01, 2006 10:19 pm   Post subject: (No subject)

well here's what I need it for: I want it to be able to receive keyboard and mouse inputs at the same time without having to go through the hasch path because when i use hasch it prevents the getch cursor from showing up and therefor confusing people as to where they're typing.
Clayton




PostPosted: Wed Nov 01, 2006 10:31 pm   Post subject: (No subject)

Instead of having them run in "parallel" processes, have it all happen in the same loop, incorporating something with Input.KeyDown and some sort of section of code to add any keyboard input to an input string.

Pseudo:

look for keyboard input (Input.KeyDown)
if theres keyboard input then
    if its a letter then
        add said letter to string
    else if its a backspace then
        delete last letter from the string
    else if its enter then
        exit the loop
look for mouse input
rinse and repeat


because the code is executed so fast, you get the illusion of the code going at the same time, you won't really notice it being any different for such a small amount of code.
DemonZ




PostPosted: Wed Nov 01, 2006 10:58 pm   Post subject: (No subject)

yah that way works much better than having a process because it will be checking Input from Mouse and keyboard at the same time in the same loop
Nerdbomb




PostPosted: Thu Nov 02, 2006 5:48 pm   Post subject: (No subject)

Oh I see, thanks for the help.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: