Boring Programming Question 

Let's say you're implementing a map function to run in parallel, how do you decide how many threads to spawn. There seems to be a pretty heavy cost to spawning a thread per cell when the list is very long, instead of having each thread process a few cells each. What's this topic called? What do I need to search for best practices?

Boring Programming Question 

@neauoire I would think spawning one thread per CPU and then having them sleep until work is ready to be sent to them would be the regular way to do things

Boring Programming Question 

@mcc I hadn't considered to poll the number of cores to make my implementation responsive :)

Follow

Boring Programming Question 

@neauoire @mcc I usually do n-1 to leave a CPU for my OS's renderer. Else it can lock up a system something fierce if your processing is heavy enough. 😅

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.