Click here to Skip to main content
15,886,258 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Adventures in Async Pin
Greg Utas29-Jun-20 0:42
professionalGreg Utas29-Jun-20 0:42 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 0:46
professionalJörgen Andersson29-Jun-20 0:46 
GeneralRe: Adventures in Async Pin
Garth J Lancaster29-Jun-20 1:04
professionalGarth J Lancaster29-Jun-20 1:04 
GeneralRe: Adventures in Async Pin
Ron Anders29-Jun-20 3:16
Ron Anders29-Jun-20 3:16 
GeneralRe: Adventures in Async Pin
Jeremy Falcon29-Jun-20 4:52
professionalJeremy Falcon29-Jun-20 4:52 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 4:57
professionalJörgen Andersson29-Jun-20 4:57 
GeneralRe: Adventures in Async Pin
dandy7229-Jun-20 5:33
dandy7229-Jun-20 5:33 
GeneralRe: Adventures in Async Pin
Stuart Dootson29-Jun-20 3:45
professionalStuart Dootson29-Jun-20 3:45 
I was going to say - size of the work done in each task is key...

But the underlying technology can also have an effect, by reducing the cost of task creation. If you're using a work queue on top of a thread pool, you're not creating a thread for each task, you're pushing/popping tasks on and off a queue.

I created a little tool to detect duplicate files using that sort of parallelism. It contains two main areas of parallelism:
  1. The file search library that I use adds a new task for each directory it sees. Each task processes just the files that are immediate children of the directory the task was created for.
  2. The detection of duplicates is split so that each task hashes a group of files that have the same size. This is performed using a data parallelism library, which makes parallelising things very easy.
The amount of speedup I get isn't anywhere near the number of processor cores in use (I get a factor of just over two speedup on an eight core machine), but I think that the amount of IO being done serialises the processing to a certain degree. Benchmarking ripgrep, another tool that uses similar parallelism, shows that running with 8 threads (on 8 logical/4 physical cores) is just over 3x faster than using 1.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Adventures in Async Pin
abmv29-Jun-20 4:31
professionalabmv29-Jun-20 4:31 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 4:54
professionalJörgen Andersson29-Jun-20 4:54 
GeneralRe: Adventures in Async Pin
abmv29-Jun-20 5:06
professionalabmv29-Jun-20 5:06 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 5:13
professionalJörgen Andersson29-Jun-20 5:13 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 5:23
professionalJörgen Andersson29-Jun-20 5:23 
GeneralRe: Adventures in Async Pin
abmv29-Jun-20 5:40
professionalabmv29-Jun-20 5:40 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 5:24
professionalJörgen Andersson29-Jun-20 5:24 
GeneralRe: Adventures in Async Pin
Jeremy Falcon29-Jun-20 4:51
professionalJeremy Falcon29-Jun-20 4:51 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 4:55
professionalJörgen Andersson29-Jun-20 4:55 
GeneralRe: Adventures in Async Pin
Jeremy Falcon29-Jun-20 4:57
professionalJeremy Falcon29-Jun-20 4:57 
GeneralRe: Adventures in Async Pin
dandy7229-Jun-20 5:35
dandy7229-Jun-20 5:35 
GeneralRe: Adventures in Async Pin
Nelek29-Jun-20 8:54
protectorNelek29-Jun-20 8:54 
GeneralRe: Adventures in Async Pin
honey the codewitch29-Jun-20 10:02
mvahoney the codewitch29-Jun-20 10:02 
GeneralRe: Adventures in Async Pin
Jörgen Andersson29-Jun-20 21:08
professionalJörgen Andersson29-Jun-20 21:08 
GeneralRe: Adventures in Async Pin
Padanian29-Jun-20 19:59
Padanian29-Jun-20 19:59 
GeneralRe: Adventures in Async Pin
kalberts29-Jun-20 20:15
kalberts29-Jun-20 20:15 
GeneralRe: Adventures in Async Pin
Padanian29-Jun-20 20:18
Padanian29-Jun-20 20:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.