how do i make a program wait indefinitely
-
i m doing an networked application.how do i make a program wait indefinitely until an input is received...like getche() or getch() in c
This code was posted by me...
-
i m doing an networked application.how do i make a program wait indefinitely until an input is received...like getche() or getch() in c
This code was posted by me...
-
The best way is to wait on
AutoResetEvent
orManualResetEvent
and once the input is constructed, to signal those eventsUri
cant we do without using thread???
This code was posted by me...
-
cant we do without using thread???
This code was posted by me...
It seems to me that your desired result is to be interrupted once the input is received. Interruption by definition means context-switching (threads). You can apply a different approach (which is not a good design), by checking a boolean variable in a while loop. As stated this isn't desired as: 1. You will waste the cpu cycles 2. You will have threads anyway 3. You will need to deal with the race condition by applying locks - as one thread will read the boolean whereas another thread will write.
Uri
-
i m doing an networked application.how do i make a program wait indefinitely until an input is received...like getche() or getch() in c
This code was posted by me...
-
i m doing an networked application.how do i make a program wait indefinitely until an input is received...like getche() or getch() in c
This code was posted by me...
Are you sure you don't want a Windows Service?
-
It seems to me that your desired result is to be interrupted once the input is received. Interruption by definition means context-switching (threads). You can apply a different approach (which is not a good design), by checking a boolean variable in a while loop. As stated this isn't desired as: 1. You will waste the cpu cycles 2. You will have threads anyway 3. You will need to deal with the race condition by applying locks - as one thread will read the boolean whereas another thread will write.
Uri
-
i m doing an networked application.how do i make a program wait indefinitely until an input is received...like getche() or getch() in c
This code was posted by me...
-
yes from network how do i block read??
This code was posted by me...
-
yes from network how do i block read??
This code was posted by me...