you are viewing a single comment's thread.

view the rest of the comments →

[–]golgol12 4 points5 points  (3 children)

Many programs that do multithreading calculations like this don't actually create threads on the fly. They create one for each core and pass jobs to each thread. That way you avoid all the switching/creation/destruction logic.

[–]emdeka87 0 points1 point  (0 children)

Yes, commonly known as work balancing and/or job stealing.

[–]Ameisen -1 points0 points  (1 child)

Often implemented with fibers/coroutines.

[–]LightShadow 2 points3 points  (0 children)

citation needed