The recent Ryzen Threadripper 3xxx series processors with up to 64 cores (128 threads) have a significantly better cost/performance ratio than other processor families. For example, a TR 3970X workstation can be bought for less than 5000€, and offers 64 threads.
Make sure to buy DDR4-3200 JEDEC memory, but observe the following table,
Memory Rank Official JEDEC frequency support 4x8 Single DDR4-3200 8x8 Single DDR4-2933 4x16 Dual DDR4-3200 8x16 Dual DDR4-2667 4x32 Dual DDR4-3200 8x32 Dual DDR4-2667
which shows that the maximum speed with which the memory controller can drive the RAM may be less than that of DDR4-3200.
The data transfer may become the bottleneck in keeping the cores busy; but 10Gb networking ports may be used, using the PCIe 4.0 bus.
The 2nd generation AMD Epyc "Rome" processors are the server variant of the Threadripper 3xxx workstation processors. They are more expensive and not quite as fast, but offer 8-channel memory and a higher maximum amount of memory than Threadripper.