LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 01-20-2006, 03:06 PM   #1
Datamike
Member
 
Registered: Oct 2003
Location: Finland
Distribution: Slackware 12.0
Posts: 34

Rep: Reputation: 15
Background and Foreground


Hi all,

I wanted to ask, since it has been annoying me greatly; what's the exact difference between running a program on the background or on the foreground? I see these terms a million times in various manuals and docs and it eludes me what they mean precisely.
 
Old 01-20-2006, 03:12 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,951

Rep: Reputation: 279Reputation: 279Reputation: 279
Say you have a program that take 30 minutes to run (it's doing something MIGHTY intensive!)

You run it in the foreground, you'll sit there waiting at your terminal until it's done before your prompt comes back and you can interact with the OS again.

In the background, your prompt will come back immediately and you can interact [edit] with the OS [/edit] while this CPU-hog program is running "in the background". You cannot easily interact with the backgrounded program, so it should be programmed operate on it's own without user input.

Of course, you could always just open up a new terminal window, but the above explains what will happen if you're limiting yourself to only one terminal session.

Last edited by haertig; 01-20-2006 at 03:13 PM.
 
Old 01-20-2006, 04:20 PM   #3
Datamike
Member
 
Registered: Oct 2003
Location: Finland
Distribution: Slackware 12.0
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks haertig, very clarifying

To extend my original question, I take it's generally possible to write a program (in whatever language; C/C++, Java, etc.) and by default set it to run in the background or the foreground? At least I think I've seen some programs behave this way, some even have commandline parameters that allows you to run it in either.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wine not in foreground ? kron1234 Linux - Games 1 06-01-2005 03:37 PM
How to change backgound/foreground colors in eclipse wearetheborg Linux - Software 0 09-13-2004 01:56 PM
How do I customize background/foreground colors in Eclipse? wearetheborg Linux - Newbie 0 09-10-2004 02:48 PM
loading foreground nautilus_1987 Slackware 6 10-10-2002 01:12 PM
tty background/foreground color neo77777 Linux - General 10 08-18-2002 03:53 PM


All times are GMT -5. The time now is 03:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration