المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : multi-threading in c#



C# Programming
01-30-2010, 01:00 AM
Hi,

I have developed an application to test some devices. The idea is to send and recieve message by device on each device in parallel. I can set for each device a timing (e.g. 100ms) between each message sending.
For that I have used the thread with time but it seems that is not the good idea because if the execution of the function need more time than the time between each send, the call is stacked into the pool execution. So when I stop the test execution, the application continue to send message due to the queue of execution in the pool.
I think that I use to many thread for one application and the runtime is very slow due to context switching or something like that.
Have an idea about the good possibility to do this application ?
I think maybe that is better if I use one service by device and the application is connected to each service to retrieve some status information. What do you think ?
Thank you for your answer...