c# - Best way to use shared memory that can be read directly by different processes without copy overhead -


i have application initialization involves reading large data files (~ > 10 gb) , performing computations on data (which of type dictionary). initialization step takes couple of hours every time though data fixed/never changed. i'd somehow use process pre-load these data memory , process on same machine read directly all data once, , without copy. far, have found couple methods:

  • .net remoting remote objects. approach bears marshaling cost wouldn't work case since data transfer result in twice memory @ 1 point.

  • memory mapped files. option still seems require data copy , case won't ideal since i'd need copy >10gb of data. have found articles using unsafe access memory addresses don't know how works.

  • wcf named pipes. approach seems similar remoting , still requires data transfer.

what's effective way scenario?

if you're putting data dictionary why not use of popular nosql key value stores (couchbase, riak, redis) process work data. if you're totally opposed idea use nancyfx framework host local rest service endpoint in "host" application other applications need make use of pre loaded data interact services provided host.


Comments