Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /FWCore/SharedMemory/Readme.md is written in an unsupported language. File is not indexed.

0001 # FWCore/SharedMemory Documentation
0002 
0003 ## Introduction
0004 This package contains code to assist in having two processes communicate via shared memory. The primary idea is to have one of the processes be cmsRun (with a module working as the Controller) and then having the other process do work on behalf of the module as its Worker. One module can have several Workers, for example one Worker per Stream. Although the various classes in the package are capable of working independently, when used together they handle most of the needs for interprocess communication.
0005 
0006 The shared memory control is being handled by boost's interprocess package.
0007 
0008 ## Classes
0009 The following are short descriptions for each class available in the package. All classes are in the edm::shared_memory namespace.
0010 
0011 ### ROOTSerializer and ROOTDeserializer
0012 These classes do not directly use shared memory. They are wrappers around ROOT's mechanism for using dictionaries to serialize and deserialize C++ objects. These classes are used in conjunction with other classes which control the memory buffer into which the object is serialized and from which it is deserialized.
0013 
0014 ### ReadBuffer and WriteBuffer
0015 A pair of ReadBuffer and WriteBuffer use the same shared memory area to communicate. They are capable of dynamically creating new buffers internally if there is a need to grow the buffer.
0016 
0017 ### ControllerChannel and WorkerChannel
0018 These classes handle synchonizing communication between the Controller and Worker processes. They handle initialization of the Worker and then processing of the various framework transitions. These classes also work with the ReadBuffer and WriteBuffer objects to synchronize communication and handling the index used when the buffers change.
0019 
0020 ### WorkerMonitorThread
0021 This class does not directly use shared memory. It is designed to use a helper thread and a signal handler to monitor the Worker process for a unix signal that will terminate the process. In the advent of such a signal, a user callable routine will be called. This is used to unlock the scoped lock being held by the WorkerChannel which will allow the Controller process to time out on its wait using that lock.