Parallelizing code -- design problem in networkish code

Sean Kelly sean at invisibleduck.org
Fri Dec 14 13:56:05 PST 2012


Do updates have to happen concurrently with read operations?  Could you maybe queue updates and batch them at specific times instead?  That would save you from having to protect every access.  Or maybe different portions of the network could be owned by different threads?  That makes it essentially a map/reduce problem.  A ReadWriteMutex might be another option to consider too.  Finally, maybe you could multiplex all of this across a thread pool--have each thread iterate across a list of delegates, each of which is tied to a single node.  That's pretty close to the std.parallelism solution.


More information about the Digitalmars-d-learn mailing list