Why stdin lose after new Thread

H

haomiao

Hi

When I create a new thread, the main thread cannot get input from
<>.

The code is like
-----------------------------------------------
while ( $line = <STDIN> ) {
chomp $line;
execCmdLine($line);
print "pp> ";
}
------------------------------------------------
In the execCmdLine function, if $line eq 'conn', a new thread is
created. Then
the main thread can not get any line at all.

How can I let the main thread continue?
 
X

xhoster

haomiao said:
Hi

When I create a new thread, the main thread cannot get input from
<>.

The code is like
-----------------------------------------------
while ( $line = <STDIN> ) {
chomp $line;
execCmdLine($line);
print "pp> ";
}
------------------------------------------------
In the execCmdLine function, if $line eq 'conn', a new thread is
created. Then
the main thread can not get any line at all.

How can I let the main thread continue?

Show us the contents execCmdLine, suitably reduced such that it does
as little as possible but still exhibits the relevant behavior.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top