Implement a parallel version of the maplist predicates which uses a pool of workers (one per CPU) to evaluate each goal. The architecture is roughly:
create a message queue from which workers read pending jobs
create a message queue to which workers write finished jobs
create one worker thread per CPU
enqueue Index-Element values to pending job queue
dequeue Index-Result values from finished job queue
sort resulting pairs by Index
return list of Result values
I have a simulation job whose core operation is performing a maplist/3 to calculate many independent values. It would be nice to use all cores for this operation.
Implement a parallel version of the maplist predicates which uses a pool of workers (one per CPU) to evaluate each goal. The architecture is roughly:
Index-Element
values to pending job queueIndex-Result
values from finished job queueIndex
Result
valuesI have a simulation job whose core operation is performing a maplist/3 to calculate many independent values. It would be nice to use all cores for this operation.