LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  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, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
tty background/foreground color neo77777 Linux - General 11 11-25-2014 08:59 AM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:15 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration