LinuxQuestions.org
Register a domain and help support LQ
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, 09: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, 04:32 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

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


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



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 04:01 PM
how to move background process to foreground batola Linux - Server 29 03-10-2010 11:28 AM
Under which circumstances a child process creates another child process using fork? mitsulas Programming 3 12-08-2009 09:16 AM
background process popping up in foreground noir911 Linux - General 1 12-15-2007 12:53 AM
Bash child process in foreground while parent dies kborgnis Programming 3 11-09-2007 07:50 AM


All times are GMT -5. The time now is 12:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration