User avatar
Deepak J
Posts: 11
Joined: Wed Apr 16, 2014 7:04 am

Running two different porgrams at a time

Sun May 25, 2014 6:17 pm

Hai I'm a absolute beginner and hence the questions I ask will be of the absolute basic standard.

I am doing a project that actually requires to run two different programs at the same time. Both of them are independent and entirely different. One of the program reads the GPIO pins and functions as a media system. Another one is used to interface the Pi with another microcontroller. And both of them should work as soon as the Pi boots. Both of them will access the storage and GPIO pins. The programs for the two tasks are written separately. As far as I've learned the RPi is a computer that runs a linux kernel and hence will support multitasking. Is that true, and should I do anything other than the normal things to run the two programs in parallel.

Thanks in advance :D
Quit, don't quit? Noodles, don't noodles? You are too concerned about what was and what will be. There is a saying: yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the "present."
- Master Oogway

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Running two different porgrams at a time

Sun May 25, 2014 6:24 pm

Yes, the Pi runs a full Linux system, although it is somewhat slower than a modern PC.

It does multi-task and can easily run several programs at the same time, the same as any other Linux system.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Running two different porgrams at a time

Sun May 25, 2014 6:28 pm

Hi,
Deepak J wrote:I am doing a project that actually requires to run two different programs at the same time.
Run them as:
FirstProgram &
SecondProgram &

(note the "&" char, which does the trick)
Deepak J wrote:And both of them should work as soon as the Pi boots.
Add commands in /etc/rc.local
Deepak J wrote:Both of them will access the storage and GPIO pins.
Hopefully, there is no GPIO pin used in both programs...


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

User avatar
Deepak J
Posts: 11
Joined: Wed Apr 16, 2014 7:04 am

Re: Running two different porgrams at a time

Sun May 25, 2014 6:40 pm

Thank you very much for the reply :D

FLYFISH TECHNOLOGIES wrote: Hopefully, there is no GPIO pin used in both programs...
Of course there are no common GPIOs :)
Quit, don't quit? Noodles, don't noodles? You are too concerned about what was and what will be. There is a saying: yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the "present."
- Master Oogway

User avatar
Deepak J
Posts: 11
Joined: Wed Apr 16, 2014 7:04 am

Re: Running two different porgrams at a time

Sun May 25, 2014 6:43 pm

Thanks for the reply :D
rpdom wrote:Yes, the Pi runs a full Linux system, although it is somewhat slower than a modern PC.
My programs don't require much of resources. It is a very basic project. I wanted to see what all extra features can be done using the RPi like interfacing with other serial devices, running multimedia etc. Thats all. I'm still a beginer ... :-)
Quit, don't quit? Noodles, don't noodles? You are too concerned about what was and what will be. There is a saying: yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the "present."
- Master Oogway

Return to “Beginners”