Creating thousands of threads quickly and simultaneously creating them

I have a C # .NET application that needs to report 4,000 to 40,000 connected devices to complete a task right away (or as close as possible to a simultaneous one).

The app works well; however, I am not satisfied with the results. In an ideal world, as soon as I send a command, I would like all devices to respond simultaneously. However, it seems that there is a delay, since all the threads that I created, unwind and complete the task.

I used ThreadPool.NET 4.0, created my own solution using custom threads, and I even tweaked the existing ThreadPool to allow multiple threads to run at the same time.

I still need better performance, which is why I am here. Any ideas? Comments? Sentence? Thank.

-Shaun

I add that the application notifies these "connected devices" of the need to listen to audio in a multicast address.

+5
source share
7 answers

A dual-core hyper-threaded processor MAY be able to execute 4 threads at the same time - depending on what the thread is doing (without competition with IO or memory access, etc.). The quad-core hyperthread is probably 8. But 40K just physically cannot happen.

, , , . , .

, . SB , UDP, , - .

+13

4000 , 40k. 8 ( ). .

40k-, .

+11

, , . HPC () / MPI .

: , 8 , 8 , 8 ( ). 6 , 40 000 . , , .

, , 8 , " " . 5 , , v-.

( ) MPI, . #.

+4

() ; . -: , -, , - !

+3

, API , ? API ? API- 40k + , . ( ), . , ; API- , , . , 40k .

+2

- . ( ) . , . - ( )

+1

.

1mb , 4-40gb RAM, 4k-40k. , .

, - , / ( , , , , ). , , , .

, 40 000 40 000 , , . , 40- .

(...).

+1
source

All Articles