Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If a thread is waiting on a console.readline is the thread suspended?

Tags:

c#

If a thread is waiting on a console.readline is the thread suspended. If not what is it's state?

like image 365
DayOne Avatar asked Apr 30 '10 12:04

DayOne


2 Answers

The thread is not suspended. It's blocked on a method call.

like image 163
dtb Avatar answered Nov 11 '22 20:11

dtb


There's not a good way to interact (i.e. wait for user input) with the console on a thread if the user doesn't ever enter information. This question (and my answer) came up with a way to terminate the input thread by having the readline in a separate process altogether.

like image 39
Jesse C. Slicer Avatar answered Nov 11 '22 22:11

Jesse C. Slicer