Click here to Skip to main content
15,914,010 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult2-Jun-08 6:22
mvePIEBALDconsult2-Jun-08 6:22 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h1-Jun-08 20:03
N a v a n e e t h1-Jun-08 20:03 
GeneralRe: how to use event to re-write this code segment? Pin
George_George2-Jun-08 1:08
George_George2-Jun-08 1:08 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h2-Jun-08 1:23
N a v a n e e t h2-Jun-08 1:23 
GeneralRe: how to use event to re-write this code segment? Pin
George_George2-Jun-08 1:48
George_George2-Jun-08 1:48 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h2-Jun-08 3:03
N a v a n e e t h2-Jun-08 3:03 
GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 1:56
George_George3-Jun-08 1:56 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h3-Jun-08 7:10
N a v a n e e t h3-Jun-08 7:10 
George_George wrote:
No. When Enqueue, the lock is still used.


Yes. Enqueue is fast and it won't block thread for anytime.

George_George wrote:
If I use timer, then each time, the timer will create a new worker thread or reuse previous one?


Timer uses thread pool thread. Obviously it will be reused.

George_George wrote:
My requirement is to complete the current task before execute next task, and between each task execution iteration, sleep 1 second so that system could have more chances to do other things


Either you can do parallel execution or sequential execution. If you need to execute the next only after the completion of first task, then you don't need such a producer/consumer solution.

All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia

How to use google | Ask smart questions

GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 15:30
George_George3-Jun-08 15:30 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h3-Jun-08 15:42
N a v a n e e t h3-Jun-08 15:42 
GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 18:25
George_George3-Jun-08 18:25 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h4-Jun-08 3:51
N a v a n e e t h4-Jun-08 3:51 
GeneralRe: how to use event to re-write this code segment? Pin
George_George4-Jun-08 20:26
George_George4-Jun-08 20:26 
GeneralRe: how to use event to re-write this code segment? Pin
N a v a n e e t h5-Jun-08 6:47
N a v a n e e t h5-Jun-08 6:47 
GeneralRe: how to use event to re-write this code segment? Pin
George_George5-Jun-08 14:51
George_George5-Jun-08 14:51 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult1-Jun-08 17:49
mvePIEBALDconsult1-Jun-08 17:49 
GeneralRe: how to use event to re-write this code segment? Pin
George_George1-Jun-08 18:34
George_George1-Jun-08 18:34 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult1-Jun-08 19:12
mvePIEBALDconsult1-Jun-08 19:12 
GeneralRe: how to use event to re-write this code segment? Pin
George_George1-Jun-08 19:17
George_George1-Jun-08 19:17 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult1-Jun-08 19:26
mvePIEBALDconsult1-Jun-08 19:26 
GeneralRe: how to use event to re-write this code segment? Pin
George_George2-Jun-08 0:52
George_George2-Jun-08 0:52 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult2-Jun-08 9:07
mvePIEBALDconsult2-Jun-08 9:07 
GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 1:36
George_George3-Jun-08 1:36 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult3-Jun-08 17:59
mvePIEBALDconsult3-Jun-08 17:59 
GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 18:27
George_George3-Jun-08 18:27 

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.