Is there a way to run two codes in a program at the same time. For example, I have this program that is getting information from two things.
Lets just say something like the following:

cin>>data from mouse;
cin>>data from other device;

Does the program get capture receive the information from top to bottom or does it get both info at the same time. My problem is that I am not sure that the info is being processed at the same time. I need to be sure since I want it to be in real time. Can someone please help me please. Is there a code to process both information at the same time.