Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question about stdin under multi-process environment. Pin
George225-Jul-03 21:36
George225-Jul-03 21:36 
GeneralRe: Question about stdin under multi-process environment. Pin
Ryan Binns25-Jul-03 23:15
Ryan Binns25-Jul-03 23:15 
GeneralRe: Question about stdin under multi-process environment. Pin
George226-Jul-03 0:58
George226-Jul-03 0:58 
GeneralRe: Question about stdin under multi-process environment. Pin
Ryan Binns26-Jul-03 1:01
Ryan Binns26-Jul-03 1:01 
GeneralRe: Question about stdin under multi-process environment. Pin
George226-Jul-03 1:05
George226-Jul-03 1:05 
GeneralRe: Question about stdin under multi-process environment. Pin
Ryan Binns26-Jul-03 2:10
Ryan Binns26-Jul-03 2:10 
GeneralRe: Question about stdin under multi-process environment. Pin
George226-Jul-03 2:16
George226-Jul-03 2:16 
GeneralRe: Question about stdin under multi-process environment. Pin
Ryan Binns26-Jul-03 2:38
Ryan Binns26-Jul-03 2:38 
George2 wrote:
So, you are wrong.

Yes and no Smile | :)

Which process gets the input will depend on which one executes the scanf() call first. Only one process can access stdin at any time - the kernel will prevent others from reading from it. So yes, processes can attempt to access stdin at the same time, and whichever one is currently waiting for input will get the input.

However, I said that the process will get the input when the user presses enter. If you put all the numbers on one line, then one process will get them all.

I hope this is all correct. I think it is, but I haven't done linux programming for about a year...

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: Question about stdin under multi-process environment. Pin
George226-Jul-03 2:44
George226-Jul-03 2:44 
GeneralRe: Question about stdin under multi-process environment. Pin
Johnny ²26-Jul-03 4:28
Johnny ²26-Jul-03 4:28 
GeneralRe: Question about stdin under multi-process environment. Pin
George226-Jul-03 16:48
George226-Jul-03 16:48 
GeneralRe: Question about stdin under multi-process environment. Pin
Johnny ²26-Jul-03 21:30
Johnny ²26-Jul-03 21:30 
GeneralRe: Question about stdin under multi-process environment. Pin
George227-Jul-03 1:14
George227-Jul-03 1:14 
GeneralRe: Question about stdin under multi-process environment. Pin
Johnny ²27-Jul-03 6:52
Johnny ²27-Jul-03 6:52 
GeneralRe: Question about stdin under multi-process environment. Pin
George227-Jul-03 15:40
George227-Jul-03 15:40 
GeneralRe: Question about stdin under multi-process environment. Pin
Bob Stanneveld25-Jul-03 23:55
Bob Stanneveld25-Jul-03 23:55 
GeneralRe: Question about stdin under multi-process environment. Pin
George226-Jul-03 1:03
George226-Jul-03 1:03 
GeneralRe: Question about stdin under multi-process environment. Pin
Bob Stanneveld27-Jul-03 1:09
Bob Stanneveld27-Jul-03 1:09 
GeneralRe: Question about stdin under multi-process environment. Pin
George227-Jul-03 1:15
George227-Jul-03 1:15 
GeneralLinking error Pin
eddymohd25-Jul-03 17:58
eddymohd25-Jul-03 17:58 
GeneralRe: Linking error Pin
Michael Dunn25-Jul-03 18:20
sitebuilderMichael Dunn25-Jul-03 18:20 
GeneralRe: Linking error Pin
eddymohd25-Jul-03 19:08
eddymohd25-Jul-03 19:08 
GeneralRe: Linking error Pin
Bob Stanneveld25-Jul-03 19:32
Bob Stanneveld25-Jul-03 19:32 
GeneralRe: Linking error Pin
Michael Dunn25-Jul-03 20:21
sitebuilderMichael Dunn25-Jul-03 20:21 
GeneralRe: Linking error Pin
Bob Stanneveld25-Jul-03 23:45
Bob Stanneveld25-Jul-03 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.