multithreading - MutliThread or Multi Lists? -


As I have seen, the theme does not recommend more than 200 threads for the server machine,

I am trying to implement the listener's class which listens to 1000 devices, I mean that 1000 tools send different types of messages in that application,

I have 2 different methods Have tried 1. Each device has a ready-made pouch for runtime and dynamic inventory, which can be used for it. Keep the device and start the thread for processing those messages from the list

but not making my machine thread more than 50 :) :) And I believe in its bad idea ... < / P>

  1. I created 10 separate lists which contain 10 different types of messages and for that list I have 10 processor threads, which go to the list related to its list And process the message and remove it But here's the problem, I say that I get 50 messages from 50 devices in list 1, its processor thread's final message of list 1 (50 V). ), Its time will expire 10 seconds

    Any ideas for the best architecture that talk to more than 500 devices and process your different types of messages with 10 seconds Does.

    Thank you ASAM


    I am working in C #, my application is connected with the client using TCP / IP with the server, this server is forward Connects to online devices, sending message to server with device ID and message data and message type and I'm receiving messages

    thanks

< Div class = "post-text" itemprop = "text">

I think you need to divide the system in a different way Shocked that the audience should have a high priority but only requests should be enqueued. The queue should then be processed using a pool of workers. You can add priority and other optimization on the dequeuing side, in relation to every process done in the 10th decade you will be able to actually get the second part of the optimized system.

Think about the traditional line system. You have a line of work requests to process. Each request has a series of properties, it allows the same name (string) and priority (int), once the work request is queued, other workers (thread / process) Etc.) on the basis of priority, can queue the queue to remove items and process them.

I can say to get 10s that a worker has started requesting a timer to request a request and that request will be marked in the 10th decade , Unless the worker will not complete the work. Other workers can see the results of the work in the queue and then handle the reaction behavior.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -