LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2013, 08:48 AM   #1
henryyao
LQ Newbie
 
Registered: Jul 2013
Posts: 23

Rep: Reputation: 0
Can I fork a foreground child process in a background process?


I ran a qt process backgroundly on my embedded linux, in this qt program, it will fork a foreground child process. And it seems to cause trouble unless i made this child process background.

What's the schemetic behind that?

Thanks
 
Old 09-06-2013, 03:32 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by henryyao View Post
I ran a qt process backgroundly on my embedded linux, in this qt program, it will fork a foreground child process. And it seems to cause trouble unless i made this child process background.
There is no difference between a foreground vs background process. What happens is the tty input is blocked when something is put in the background and another process is started in the foreground. Once the terminal is blocked, there is nothing that can be done in the background to recover it.

The designation of "background" is just that the shell doesn't wait for it to exit before going to the next prompt - and that tends to block the input, causing the "background" process to wait when it tries to read from stdin.

Quote:
What's the schemetic behind that?

Thanks
Don't do that.
 
1 members found this post helpful.
  


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
how to Place a process in the background, Bring to foreground janakiramulu Ubuntu 4 05-18-2011 03:01 PM
how to move background process to foreground batola Linux - Server 29 03-10-2010 10:28 AM
Under which circumstances a child process creates another child process using fork? mitsulas Programming 3 12-08-2009 08:16 AM
background process popping up in foreground noir911 Linux - General 1 12-14-2007 11:53 PM
Bash child process in foreground while parent dies kborgnis Programming 3 11-09-2007 06:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:32 AM.

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