Click here to Skip to main content
15,921,548 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionQuestion about Thread.Sleep() Pin
Tristan Rhodes7-May-07 10:45
Tristan Rhodes7-May-07 10:45 
AnswerRe: Question about Thread.Sleep() Pin
Wilco07-May-07 11:03
Wilco07-May-07 11:03 
GeneralRe: Question about Thread.Sleep() Pin
Tristan Rhodes7-May-07 11:14
Tristan Rhodes7-May-07 11:14 
AnswerRe: Question about Thread.Sleep() Pin
simsem7-May-07 20:55
simsem7-May-07 20:55 
GeneralRe: Question about Thread.Sleep() Pin
Tristan Rhodes8-May-07 2:51
Tristan Rhodes8-May-07 2:51 
GeneralRe: Question about Thread.Sleep() Pin
Colin Angus Mackay10-May-07 2:14
Colin Angus Mackay10-May-07 2:14 
GeneralRe: Question about Thread.Sleep() Pin
Tristan Rhodes10-May-07 2:35
Tristan Rhodes10-May-07 2:35 
GeneralRe: Question about Thread.Sleep() Pin
Colin Angus Mackay10-May-07 3:42
Colin Angus Mackay10-May-07 3:42 
Tristan Rhodes wrote:
Would it be efficient to do something along these lines:


I'm presuming that cmdResponse will be set in the callback method on the other thread.


Tristan Rhodes wrote:
And that should free up the db wait time for other requests?


What other requests? If my assumption is correct, you have taken an asynchonous request and effectively turned it back in to a synchronous request by waiting for the call back function to return.

Now, if you were to do something between the BeginInvoke and waiting for the call back method to populate cmdResponse then there might be some point.

When you are waiting for a database call to return from the server the thread will be blocked and the scheduler will skip past it until something is available for it to do.


Upcoming events:
* Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services...

Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton


My website

GeneralRe: Question about Thread.Sleep() Pin
Tristan Rhodes10-May-07 4:29
Tristan Rhodes10-May-07 4:29 
GeneralRe: Question about Thread.Sleep() Pin
Colin Angus Mackay10-May-07 5:54
Colin Angus Mackay10-May-07 5:54 
GeneralRe: Question about Thread.Sleep() Pin
Tristan Rhodes10-May-07 6:25
Tristan Rhodes10-May-07 6:25 
QuestionHow do you halt a program while waiting for a KeyDown? Pin
vonLochow6-May-07 23:28
vonLochow6-May-07 23:28 
AnswerRe: How do you halt a program while waiting for a KeyDown? Pin
Arun.Immanuel7-May-07 1:30
Arun.Immanuel7-May-07 1:30 
QuestionWindows Workflow Rules question Pin
abc8766-May-07 21:21
abc8766-May-07 21:21 
Questionneed help with remoting incoming event handler Pin
neodeaths6-May-07 16:34
neodeaths6-May-07 16:34 
AnswerRe: need help with remoting incoming event handler Pin
Wilco07-May-07 4:32
Wilco07-May-07 4:32 
QuestionProblem With Custom PaperSize In .NET Pin
AmirAlilou4-May-07 21:56
AmirAlilou4-May-07 21:56 
Questionhow do i set the values for my class variable for remoting? Pin
neodeaths3-May-07 23:22
neodeaths3-May-07 23:22 
QuestionCode convertor tool in Vb .net Pin
Balagurunathan S3-May-07 21:51
Balagurunathan S3-May-07 21:51 
AnswerRe: Code convertor tool in Vb .net Pin
Blumen3-May-07 23:02
Blumen3-May-07 23:02 
GeneralRe: Code convertor tool in Vb .net Pin
Balagurunathan S4-May-07 0:03
Balagurunathan S4-May-07 0:03 
GeneralRe: Code convertor tool in Vb .net Pin
Christian Graus6-May-07 17:58
protectorChristian Graus6-May-07 17:58 
AnswerRe: Code convertor tool in Vb .net Pin
Blumen7-May-07 5:48
Blumen7-May-07 5:48 
AnswerRe: Code convertor tool in Vb .net Pin
Dave Kreskowiak4-May-07 2:33
mveDave Kreskowiak4-May-07 2:33 
GeneralRe: Code convertor tool in Vb .net Pin
Blumen8-May-07 2:14
Blumen8-May-07 2:14 

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.