10

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

ThinkingStiff
  • 63,812
  • 29
  • 142
  • 238
DayOne
  • 987
  • 1
  • 9
  • 16
  • possible duplicate of [How to add a Timeout to Console.ReadLine()?](http://stackoverflow.com/questions/57615/how-to-add-a-timeout-to-console-readline) – Jesse C. Slicer Oct 27 '14 at 11:48

2 Answers2

17

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

dtb
  • 206,299
  • 34
  • 391
  • 426
1

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.

Community
  • 1
  • 1
Jesse C. Slicer
  • 19,457
  • 3
  • 66
  • 82