OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
ossimMultiThreadSequencer Class Reference

This class manages the sequencing of tile requests across multiple threads. More...

#include <ossimMultiThreadSequencer.h>

Inheritance diagram for ossimMultiThreadSequencer:
ossimImageSourceSequencer ossimImageSource ossimConnectableObjectListener ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Classes

class  ossimGetTileCallback
 Private class for getTile job callbacks. More...
 
class  ossimGetTileJob
 Private class representing a getTile job. More...
 

Public Member Functions

 ossimMultiThreadSequencer (ossimImageSource *inputSource=NULL, ossim_uint32 num_threads=0, ossimObject *owner=NULL)
 
virtual ~ossimMultiThreadSequencer ()
 
virtual void setToStartOfSequence ()
 Overrides base class implementation. More...
 
virtual ossimRefPtr< ossimImageDatagetNextTile (ossim_uint32 resLevel=0)
 Overrides base class in order to implement multi-threaded tile requests. More...
 
void setNumberOfThreads (ossim_uint32 num_threads)
 Specifies number of thread to support. More...
 
ossim_uint32 getNumberOfThreads () const
 Fetches the number of threads being used. Useful when this object decides the quantity. More...
 
ossim_uint32 maxCacheSize () const
 Accessed for performance logging. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
void setUseSharedHandlers (bool use_shared_handlers)
 
void setCacheTileSize (ossim_uint32 cache_tile_size)
 
void setUseCache (bool use_cache)
 
double handlerGetTileT ()
 
- Public Member Functions inherited from ossimImageSourceSequencer
 ossimImageSourceSequencer (ossimImageSource *inputSource=NULL, ossimObject *owner=NULL)
 
virtual ~ossimImageSourceSequencer ()
 
ossim_int64 getNumberOfTiles () const
 
ossim_int64 getNumberOfTilesHorizontal () const
 
ossim_int64 getNumberOfTilesVertical () const
 
virtual void initialize ()
 
virtual void setAreaOfInterest (const ossimIrect &areaOfInterest)
 
const ossimIrectgetAreaOfInterest () const
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual bool getNextTileStream (std::ostream &bos)
 
virtual bool getTileOrigin (ossim_int64 id, ossimIpt &origin) const
 
bool getTileRect (ossim_int64 tile_id, ossimIrect &rect) const
 Establishes a tile rect given tile ID. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (ossim_int64 id, ossim_uint32 resLevel=0)
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 This will return the bounding rect of the source. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 Will return the decimation factor for the given resolution level. More...
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Will return the number of resolution levels. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 
virtual ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. More...
 
virtual void slaveProcessTiles ()
 
virtual bool isMaster () const
 
virtual ossimIpt getTileSize () const
 
virtual void setTileSize (const ossimIpt &tileSize)
 
virtual void setTileSize (ossim_int32 width, ossim_int32 height)
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Returns the min pixel of the band. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
void setCreateHistogram (bool create_histogram)
 
void getBinInformation (ossim_uint32 &numberOfBins, ossim_float64 &minValue, ossim_float64 &maxValue, ossimScalarType stype) const
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if not defined. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual void saveImageGeometry () const
 Default method to call input's saveImageGeometry. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Default method to call input's saveImageGeometry. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimConnectableObjectListener
 ossimConnectableObjectListener ()
 
virtual ~ossimConnectableObjectListener ()
 
virtual void processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &)
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void propertyEvent (ossimPropertyEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
virtual void refreshEvent (ossimRefreshEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Public Attributes

ossim_uint32 d_maxCacheUsed
 
ossim_uint32 d_cacheEmptyCount
 
double d_idleTime1
 
double d_idleTime2
 
double d_idleTime3
 
double d_idleTime4
 
double d_idleTime5
 
double d_idleTime6
 
double d_jobGetTileT
 
bool d_useSharedHandlers
 
ossim_uint32 d_cacheTileSize
 
bool d_useCache
 

Protected Types

typedef std::map< ossim_uint32, ossimRefPtr< ossimImageData > > TileCache
 

Protected Member Functions

void initJobs ()
 Queues up the optimum amount of jobs given the availability of thread chains and space in the output tile cache. More...
 
void setTileInCache (ossim_uint32 tile_id, ossimImageData *tile, ossim_uint32 chain_id, double dt)
 Access method to tile cache with scope lock to avoid multiple threads writing to the cache simultaneously. More...
 
void nextJob (ossim_uint32 chain_id)
 Method to job queue with scope lock to avoid multiple threads modifying the queue simultaneously. More...
 
void print (ostringstream &msg) const
 For debug – thread-safe console output. More...
 
- Protected Member Functions inherited from ossimImageSourceSequencer
virtual void updateTileDimensions ()
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

ossimRefPtr< ossimImageChainMtAdaptorm_inputChain
 Same as base class' theInputConnection. More...
 
std::shared_ptr< ossimJobMultiThreadQueuem_jobMtQueue
 
ossim_uint32 m_numThreads
 
std::shared_ptr< ossimGetTileCallbackm_callback
 
ossim_uint32 m_nextTileID
 ID of next tile to be threaded, different from base class' theCurrentTileNumber. More...
 
TileCache m_tileCache
 Saves tiles output by threaded jobs. More...
 
ossim_uint32 m_maxCacheSize
 
ossim_uint32 m_maxTileCacheFactor
 
std::mutex m_cacheMutex
 
std::mutex m_jobMutex
 
ossim_uint32 m_totalNumberOfTiles
 
ossim::Block m_getTileBlock
 
ossim::Block m_nextJobBlock
 
std::mutex d_printMutex
 
std::mutex d_timerMutex
 
bool d_debugEnabled
 
ossim_uint32 d_timedBlocksDt
 
bool d_timeMetricsEnabled
 
double d_t1
 
- Protected Attributes inherited from ossimImageSourceSequencer
ossimImageSourcetheInputConnection
 
ossimRefPtr< ossimImageDatatheBlankTile
 
ossimRefPtr< ossimMultiResLevelHistogramtheHistogram
 
ossimIrect theAreaOfInterest
 
ossimIpt theTileSize
 
ossim_int64 theNumberOfTilesHorizontal
 
ossim_int64 theNumberOfTilesVertical
 
ossim_int64 theCurrentTileNumber
 
bool theCreateHistogram
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 

Friends

class ossimGetTileJob
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Detailed Description

This class manages the sequencing of tile requests across multiple threads.

Note that multi- threading can only be achieved through the use of getNextTile() method for sequencing. Conventional getTiles will not be multi-threaded.

Definition at line 26 of file ossimMultiThreadSequencer.h.

Member Typedef Documentation

◆ TileCache

Definition at line 75 of file ossimMultiThreadSequencer.h.

Constructor & Destructor Documentation

◆ ossimMultiThreadSequencer()

ossimMultiThreadSequencer::ossimMultiThreadSequencer ( ossimImageSource inputSource = NULL,
ossim_uint32  num_threads = 0,
ossimObject owner = NULL 
)

Definition at line 80 of file ossimMultiThreadSequencer.cpp.

83  : ossimImageSourceSequencer(input, owner),
84  d_maxCacheUsed(0),
86  d_idleTime1(0.0),
87  d_idleTime2(0.0),
88  d_idleTime3(0.0),
89  d_idleTime4(0.0),
90  d_idleTime5(0.0),
91  d_idleTime6(0.0),
92  d_jobGetTileT(0.0),
93  m_inputChain(0),
94  m_jobMtQueue(0),
95  m_numThreads (num_threads),
96  m_callback(std::make_shared<ossimGetTileCallback>()),
97  m_nextTileID (0),
98  m_tileCache(),
99  m_maxCacheSize (DEFAULT_MAX_TILE_CACHE_FACTOR * num_threads),
100  m_maxTileCacheFactor (DEFAULT_MAX_TILE_CACHE_FACTOR),
101  m_cacheMutex(),
102  m_jobMutex(),
104  m_getTileBlock(),
105  m_nextJobBlock(),
106  d_printMutex(),
107  d_timerMutex(),
108  d_debugEnabled(false),
109  d_timedBlocksDt(0),
110  d_timeMetricsEnabled(false),
111  d_useSharedHandlers(true),
112  d_cacheTileSize(1024),
113  d_useCache(true),
114  d_t1(0.0)
115 {
116  //###### DEBUG ############
117  ossimMtDebug* mt_debug = ossimMtDebug::instance();
118  if (mt_debug->maxTileCacheSize != 0)
119  m_maxCacheSize = mt_debug->maxTileCacheSize;
120  d_debugEnabled = mt_debug->seqDebugEnabled;
121  d_timedBlocksDt = mt_debug->seqTimedBlocksDt;
123  //###### END DEBUG ############
124 
125  // The base-class' initialize() method should have been called by the base class constructor
126  // unless somebody moved it!
130 }
ossim_uint32 m_nextTileID
ID of next tile to be threaded, different from base class&#39; theCurrentTileNumber.
void setStartTick()
Set the start.
Definition: ossimTimer.h:27
std::shared_ptr< ossimGetTileCallback > m_callback
ossim_uint32 seqTimedBlocksDt
Definition: ossimMtDebug.h:36
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
bool seqDebugEnabled
Definition: ossimMtDebug.h:35
void release()
Releases the threads and will not return until all threads are released.
Definition: Block.cpp:66
static ossimTimer * instance()
Definition: ossimTimer.cpp:19
ossim_uint32 maxTileCacheSize
Definition: ossimMtDebug.h:38
ossimImageSourceSequencer(ossimImageSource *inputSource=NULL, ossimObject *owner=NULL)
bool seqMetricsEnabled
Definition: ossimMtDebug.h:37
std::shared_ptr< ossimJobMultiThreadQueue > m_jobMtQueue
TileCache m_tileCache
Saves tiles output by threaded jobs.
For debugging purposes. To be removed with final release:
Definition: ossimMtDebug.h:7
static ossimMtDebug * instance()
Definition: ossimMtDebug.h:24

◆ ~ossimMultiThreadSequencer()

ossimMultiThreadSequencer::~ossimMultiThreadSequencer ( )
virtual

< Same as base class' theInputConnection

Definition at line 135 of file ossimMultiThreadSequencer.cpp.

References m_callback, m_inputChain, and m_jobMtQueue.

136 {
137  m_inputChain = 0;
138  m_jobMtQueue = 0;
139  m_callback.reset();
140 }
std::shared_ptr< ossimGetTileCallback > m_callback
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
std::shared_ptr< ossimJobMultiThreadQueue > m_jobMtQueue

Member Function Documentation

◆ getNextTile()

ossimRefPtr< ossimImageData > ossimMultiThreadSequencer::getNextTile ( ossim_uint32  resLevel = 0)
virtual

Overrides base class in order to implement multi-threaded tile requests.

The output tile should be available in the tile cache, otherwise, method waits until it becomes available.

Reimplemented from ossimImageSourceSequencer.

Definition at line 231 of file ossimMultiThreadSequencer.cpp.

References ossim::Block::block(), d_cacheEmptyCount, d_debugEnabled, d_idleTime1, d_idleTime2, d_idleTime3, d_t1, d_timedBlocksDt, d_timeMetricsEnabled, ossimTimer::instance(), m_cacheMutex, m_getTileBlock, m_inputChain, m_nextJobBlock, m_nextTileID, m_tileCache, m_totalNumberOfTiles, print(), ossim::Block::release(), ossim::Block::reset(), setToStartOfSequence(), ossimImageSourceSequencer::theCurrentTileNumber, ossimTimer::time_s(), and ossimRefPtr< T >::valid().

232 {
233  if (!m_inputChain.valid())
234  return NULL;
235 
236  // May need to initiate the threaded sequencing if not already done:
237  if (m_nextTileID == 0)
239 
240  // Terminate with null return if done:
243  {
244  return tile;
245  }
246 
247  // May need to wait until the corresponding job is finished if the tile is not in the cache:
248  TileCache::iterator tile_iter = m_tileCache.begin();
249  while (!tile.valid())
250  {
251  // If the tile is not yet copied into the cache, it means the job is still running. Let's
252  // block this thread and let the getTile jobs unlock as they finish. We'll exit this loop
253  // when the job of interest finishes.
256  m_cacheMutex.lock();
259 
260  // RP - Just grab the first tile for better performance, because order does not matter, we need
261  // to process them all
262  tile_iter = m_tileCache.begin(); //.find(theCurrentTileNumber);
263  m_cacheMutex.unlock();
264 
265  if (tile_iter == m_tileCache.end())
266  {
267  if (d_debugEnabled)
268  {
269  ostringstream s1;
270  s1<<"getNextTile() -- Waiting on tile #"<<theCurrentTileNumber;
271  m_cacheMutex.lock();
272  s1<<"\n cache size = "<<m_tileCache.size();
273  TileCache::iterator iter = m_tileCache.begin();
274  while(iter != m_tileCache.end())
275  {
276  s1<<"\n cache.tile_id = "<<iter->first;
277  iter++;
278  }
279  m_cacheMutex.unlock();
280  print(s1);
281  }
282 
283  if (d_timedBlocksDt > 0)
285  else
286  {
293  }
294  }
295  else
296  {
297  // A valid tile was found. Need to assign the output tile and free up the reference in the
298  // cache:
299  if (d_debugEnabled)
300  {
301  ostringstream s2;
302  s2<<"getNextTile() -- Copying tile #"<<theCurrentTileNumber<<". Cache size: "<<m_tileCache.size();
303  print(s2);
304  }
305  tile = tile_iter->second;
306 
309  m_cacheMutex.lock();
310  m_tileCache.erase(tile_iter);
311  m_cacheMutex.unlock();
314 
315  if (m_tileCache.empty())
317  m_nextJobBlock.release(); // nextJob() may be blocked until cache space is freed
318  }
319  }
320 
321  // Advance the caller-requested tile ID. This is different from the last threaded getTile()'s
322  // tile index maintained in m_nextTileID and advanced in initNextJob():
324  return tile;
325 }
ossim_uint32 m_nextTileID
ID of next tile to be threaded, different from base class&#39; theCurrentTileNumber.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual void setToStartOfSequence()
Overrides base class implementation.
bool valid() const
Definition: ossimRefPtr.h:75
void print(ostringstream &msg) const
For debug – thread-safe console output.
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
void release()
Releases the threads and will not return until all threads are released.
Definition: Block.cpp:66
static ossimTimer * instance()
Definition: ossimTimer.cpp:19
double time_s() const
Get elapsed time in seconds.
Definition: ossimTimer.h:33
void block()
Will block the calling thread based on the internal condition.
Definition: Block.cpp:33
TileCache m_tileCache
Saves tiles output by threaded jobs.
void reset()
Simple reset the values.
Definition: Block.cpp:78

◆ getNumberOfThreads()

ossim_uint32 ossimMultiThreadSequencer::getNumberOfThreads ( ) const
inline

Fetches the number of threads being used. Useful when this object decides the quantity.

Definition at line 48 of file ossimMultiThreadSequencer.h.

Referenced by ossimIgen::outputProduct().

48 { return m_numThreads; }

◆ handlerGetTileT()

double ossimMultiThreadSequencer::handlerGetTileT ( )

Definition at line 465 of file ossimMultiThreadSequencer.cpp.

References ossimImageHandlerMtAdaptor::d_getTileT, m_inputChain, ossimImageChainMtAdaptor::m_sharedHandlers, and ossimRefPtr< T >::valid().

Referenced by ossimIgen::outputProduct().

466 {
467  if (m_inputChain->m_sharedHandlers.empty())
468  return -1.0;
470  if (ha.valid())
471  return ha->d_getTileT;
472  return -1;
473 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.

◆ initJobs()

void ossimMultiThreadSequencer::initJobs ( )
protected

Queues up the optimum amount of jobs given the availability of thread chains and space in the output tile cache.

◆ loadState()

bool ossimMultiThreadSequencer::loadState ( const ossimKeywordlist kwl,
const char *  prefix 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageSourceSequencer.

Definition at line 475 of file ossimMultiThreadSequencer.cpp.

References ossimKeywordlist::find(), ossimImageSourceSequencer::loadState(), setCacheTileSize(), setNumberOfThreads(), setUseCache(), setUseSharedHandlers(), status, ossimString::toBool(), and ossimString::toUInt32().

476 {
477  const char* lookup;
478  lookup = kwl.find(prefix, "num_threads");
479  if(lookup)
480  {
481  ossim_uint32 num_threads = ossimString(lookup).toUInt32();
482  setNumberOfThreads(num_threads);
483  }
484  lookup = kwl.find(prefix, "use_shared_handlers");
485  if(lookup)
486  {
487  bool use_shared_handlers = ossimString(lookup).toBool();
488  setUseSharedHandlers(use_shared_handlers);
489  }
490  lookup = kwl.find(prefix, "cache_tile_size");
491  if(lookup)
492  {
493  ossim_uint32 cache_tile_size = ossimString(lookup).toUInt32();
494  setCacheTileSize(cache_tile_size);
495  }
496  lookup = kwl.find(prefix, "use_cache");
497 
498  if(lookup)
499  {
500  bool use_cache = ossimString(lookup).toBool();
501  setUseCache(use_cache);
502  }
503 
504  bool status = ossimImageSourceSequencer::loadState(kwl, prefix);
505 
506  return status;
507 }
void setNumberOfThreads(ossim_uint32 num_threads)
Specifies number of thread to support.
void setUseSharedHandlers(bool use_shared_handlers)
const char * find(const char *key) const
ossim_uint32 toUInt32() const
bool toBool() const
String to numeric methods.
unsigned int ossim_uint32
bool loadState(const ossimKeywordlist &kwl, const char *prefix)
Method to the load (recreate) the state of an object from a keyword list.
return status
void setCacheTileSize(ossim_uint32 cache_tile_size)

◆ maxCacheSize()

ossim_uint32 ossimMultiThreadSequencer::maxCacheSize ( ) const
inline

Accessed for performance logging.

Definition at line 51 of file ossimMultiThreadSequencer.h.

◆ nextJob()

void ossimMultiThreadSequencer::nextJob ( ossim_uint32  chain_id)
protected

Method to job queue with scope lock to avoid multiple threads modifying the queue simultaneously.

Definition at line 401 of file ossimMultiThreadSequencer.cpp.

References ossim::Block::block(), d_debugEnabled, d_idleTime5, d_idleTime6, d_t1, d_timedBlocksDt, d_timeMetricsEnabled, ossimTimer::instance(), m_cacheMutex, m_callback, m_jobMtQueue, m_jobMutex, m_maxCacheSize, m_nextJobBlock, m_nextTileID, m_tileCache, m_totalNumberOfTiles, print(), ossim::Block::reset(), and ossimTimer::time_s().

Referenced by ossimMultiThreadSequencer::ossimGetTileJob::run().

402 {
403  // Check for end of sequence:
405  return;
406 
407  while (((ossim_uint32) m_tileCache.size()) >= m_maxCacheSize)
408  {
409  if (d_debugEnabled)
410  {
411  m_cacheMutex.lock();
412  TileCache::const_iterator iter = m_tileCache.begin();
413  ostringstream s1;
414  s1<<"THREAD #"<<chain_id<<" -- nextJob() Waiting on cache before queuing tile/job #"
415  <<m_nextTileID<<"using chain #"<<chain_id<<". Cache size: "<<m_tileCache.size();
416  while(iter != m_tileCache.end())
417  {
418  s1<<"\n cache.tile_id = "<<iter->first;
419  iter++;
420  }
421  m_cacheMutex.unlock();
422  print(s1);
423  }
424 
425  if (d_timedBlocksDt > 0)
427  else
428  {
435  }
436  }
437 
438  if (d_debugEnabled)
439  {
440  ostringstream s2;
441  s2<<"THREAD #"<<chain_id<<" -- nextJob() Queuing tile/job #"<<m_nextTileID;
442  print(s2);
443  }
444 
445  // Job queue will receive pointer into ossimRefPtr so no leak here:
448  std::lock_guard<std::mutex> lock(m_jobMutex);
451 
452  std::shared_ptr<ossimGetTileJob> job = std::make_shared<ossimGetTileJob>(m_nextTileID++, chain_id, *this);
453  job->setCallback(m_callback);
454  m_jobMtQueue->getJobQueue()->add(job);
455 }
ossim_uint32 m_nextTileID
ID of next tile to be threaded, different from base class&#39; theCurrentTileNumber.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
std::shared_ptr< ossimGetTileCallback > m_callback
void print(ostringstream &msg) const
For debug – thread-safe console output.
static ossimTimer * instance()
Definition: ossimTimer.cpp:19
double time_s() const
Get elapsed time in seconds.
Definition: ossimTimer.h:33
unsigned int ossim_uint32
std::shared_ptr< ossimJobMultiThreadQueue > m_jobMtQueue
void block()
Will block the calling thread based on the internal condition.
Definition: Block.cpp:33
TileCache m_tileCache
Saves tiles output by threaded jobs.
void reset()
Simple reset the values.
Definition: Block.cpp:78

◆ print()

void ossimMultiThreadSequencer::print ( ostringstream &  msg) const
protected

For debug – thread-safe console output.

Definition at line 460 of file ossimMultiThreadSequencer.cpp.

References d_printMutex.

Referenced by getNextTile(), nextJob(), ossimMultiThreadSequencer::ossimGetTileJob::run(), setTileInCache(), and setToStartOfSequence().

461 {
462  std::lock_guard<std::mutex> lock(d_printMutex);
463  cerr << msg.str() << endl;
464 }

◆ setCacheTileSize()

void ossimMultiThreadSequencer::setCacheTileSize ( ossim_uint32  cache_tile_size)

Definition at line 353 of file ossimMultiThreadSequencer.cpp.

References d_cacheTileSize, m_inputChain, ossimImageChainMtAdaptor::setCacheTileSize(), and ossimRefPtr< T >::valid().

Referenced by loadState().

354 {
355  d_cacheTileSize = cache_tile_size;
356 
357  if (m_inputChain.valid())
358  m_inputChain->setCacheTileSize(cache_tile_size);
359 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
void setCacheTileSize(ossim_uint32 cache_tile_size)

◆ setNumberOfThreads()

void ossimMultiThreadSequencer::setNumberOfThreads ( ossim_uint32  num_threads)

Specifies number of thread to support.

Default behavior (if this method is never called) is to query the system for number of cores available.

Definition at line 331 of file ossimMultiThreadSequencer.cpp.

References m_inputChain, m_jobMtQueue, m_maxCacheSize, m_maxTileCacheFactor, m_nextTileID, m_numThreads, ossimImageChainMtAdaptor::setNumberOfThreads(), and ossimRefPtr< T >::valid().

Referenced by loadState().

332 {
333  m_numThreads = num_threads;
335 
336  if (m_inputChain.valid())
337  m_inputChain->setNumberOfThreads(num_threads);
338 
339  if (m_jobMtQueue && m_jobMtQueue->hasJobsToProcess())
340  m_jobMtQueue->getJobQueue()->clear();
341 
342  m_nextTileID = 0; // effectively resets this sequencer
343 }
ossim_uint32 m_nextTileID
ID of next tile to be threaded, different from base class&#39; theCurrentTileNumber.
bool valid() const
Definition: ossimRefPtr.h:75
void setNumberOfThreads(ossim_uint32 num_threads)
Alternate way of specifying number of threads to support.
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
std::shared_ptr< ossimJobMultiThreadQueue > m_jobMtQueue

◆ setTileInCache()

void ossimMultiThreadSequencer::setTileInCache ( ossim_uint32  tile_id,
ossimImageData tile,
ossim_uint32  chain_id,
double  dt 
)
protected

Access method to tile cache with scope lock to avoid multiple threads writing to the cache simultaneously.

NOTE: chain_id being passed only for debug. To be removed.

Definition at line 373 of file ossimMultiThreadSequencer.cpp.

References d_debugEnabled, d_idleTime4, d_jobGetTileT, d_maxCacheUsed, d_t1, d_timeMetricsEnabled, ossimTimer::instance(), m_cacheMutex, m_tileCache, print(), and ossimTimer::time_s().

Referenced by ossimMultiThreadSequencer::ossimGetTileJob::run().

377 {
380  std::lock_guard<std::mutex> lock(m_cacheMutex);
383 
384  d_jobGetTileT += dt;
385 
386  m_tileCache[tile_id] = tile;
387  if (d_debugEnabled)
388  {
389  ostringstream s2;
390  s2<<"THREAD #"<<chain_id<<" -- setTileInCache() Wrote tile #"<<tile_id;
391  print(s2);
392  }
393  if (d_maxCacheUsed < m_tileCache.size())
395 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
void print(ostringstream &msg) const
For debug – thread-safe console output.
static ossimTimer * instance()
Definition: ossimTimer.cpp:19
double time_s() const
Get elapsed time in seconds.
Definition: ossimTimer.h:33
unsigned int ossim_uint32
TileCache m_tileCache
Saves tiles output by threaded jobs.

◆ setToStartOfSequence()

void ossimMultiThreadSequencer::setToStartOfSequence ( )
virtual

Overrides base class implementation.

Overrides base class in order to implement multi-threaded tile requests.

This call initiates the multi-threaded getTile jobs for the first N tiles.

The base class should have successfully assigned its input:

Reimplemented from ossimImageSourceSequencer.

Definition at line 145 of file ossimMultiThreadSequencer.cpp.

References ossimImageChain::add(), d_cacheTileSize, d_debugEnabled, d_useCache, d_useSharedHandlers, ossimConnectableObject::disconnectAllOutputs(), ossim::getNumberOfThreads(), m_callback, m_inputChain, m_jobMtQueue, m_maxCacheSize, m_maxTileCacheFactor, m_nextTileID, m_numThreads, m_totalNumberOfTiles, print(), ossimImageChainMtAdaptor::setCacheTileSize(), ossimImageChainMtAdaptor::setNumberOfThreads(), ossimImageChainMtAdaptor::setUseCache(), ossimImageChainMtAdaptor::setUseSharedHandlers(), ossimImageSourceSequencer::theCurrentTileNumber, ossimImageSourceSequencer::theInputConnection, ossimImageSourceSequencer::theNumberOfTilesHorizontal, ossimImageSourceSequencer::theNumberOfTilesVertical, and ossimRefPtr< T >::valid().

Referenced by getNextTile().

146 {
147  // Reset important indices:
149  m_nextTileID = 0;
151 
153  if (theInputConnection == NULL)
154  return;
155 
156  // Check if this param was already set externally. Query the system capability if not:
157  if (m_numThreads == 0)
158  {
161  }
162 
163  // Adapt the input source to be an ossimImageChainMtAdaptor since we can only work
164  // with this type:
166  if (m_inputChain.valid())
167  {
172  }
173  else
174  {
175  // Need to adapt input. First, is it a chain?
176  ossimImageChain* chain = dynamic_cast<ossimImageChain*>(theInputConnection);
177  if (chain == NULL)
178  {
179  // The input is just a common image source. Make it a chain:
180  chain = new ossimImageChain;
181  chain->add(theInputConnection);
182  }
183 
184  // This instantiation creates a set of cloned image chains, one per thread, that will be
185  // accessed in parallel for the getTile() operation:
187  }
188 
189  // Set the output of the chain to be this sequencer:
191  //connectMyInputTo(m_inputChain.get());
192  //setAreaOfInterest(m_inputChain->getBoundingRect());
193 
195  for (ossim_uint32 i=0; i<m_numThreads; ++i)
196  {
197  std::shared_ptr<ossimGetTileJob> job = std::make_shared<ossimGetTileJob>(m_nextTileID++, i, *this);
198  job->setCallback(m_callback);
199  job->t_launchNewJob = false;
200  job->start();
201  }
202 
203  // Set up the job queue and fill it with first N jobs:
204  ossim_uint32 num_jobs_to_launch = min<ossim_uint32>(m_numThreads, m_totalNumberOfTiles);
205  std::shared_ptr<ossimJobQueue> jobQueue = std::make_shared<ossimJobQueue>();
206  for (ossim_uint32 chain_id=0; chain_id<num_jobs_to_launch; ++chain_id)
207  {
208  if (d_debugEnabled)
209  {
210  ostringstream s;
211  s<<"setToStartOfSequence() -- Creating tile/job #"<<m_nextTileID;
212  print(s);
213  }
214 
215  std::shared_ptr<ossimGetTileJob> job = std::make_shared<ossimGetTileJob>(m_nextTileID++, chain_id, *this);
216  job->setCallback(m_callback);
217  jobQueue->add(job, false);
218  }
219 
220  // Initialize the multi-thread queue. Note the setJobQueue is done after construction as it was
221  // crashing do to jobs being launched during init:
222  m_jobMtQueue = std::make_shared<ossimJobMultiThreadQueue>(nullptr, num_jobs_to_launch);
223  m_jobMtQueue->setJobQueue(jobQueue);
224 }
ossim_uint32 m_nextTileID
ID of next tile to be threaded, different from base class&#39; theCurrentTileNumber.
virtual void disconnectAllOutputs()
Will disconnect all of the output objects.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
bool valid() const
Definition: ossimRefPtr.h:75
std::shared_ptr< ossimGetTileCallback > m_callback
void print(ostringstream &msg) const
For debug – thread-safe console output.
void setNumberOfThreads(ossim_uint32 num_threads)
Alternate way of specifying number of threads to support.
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
OSSIM_DLL ossim_uint32 getNumberOfThreads()
Get the number threads to use from ossimPreferences or ossim::Thread.
void setUseSharedHandlers(bool use_shared_handlers)
unsigned int ossim_uint32
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
std::shared_ptr< ossimJobMultiThreadQueue > m_jobMtQueue
This class supports multi-threading of image chain getTile() requests and associated chain updating...
void setCacheTileSize(ossim_uint32 cache_tile_size)

◆ setUseCache()

void ossimMultiThreadSequencer::setUseCache ( bool  use_cache)

Definition at line 361 of file ossimMultiThreadSequencer.cpp.

References d_useCache, m_inputChain, ossimImageChainMtAdaptor::setUseCache(), and ossimRefPtr< T >::valid().

Referenced by loadState().

362 {
363  d_useCache = use_cache;
364 
365  if (m_inputChain.valid())
366  m_inputChain->setUseCache(use_cache);
367 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.

◆ setUseSharedHandlers()

void ossimMultiThreadSequencer::setUseSharedHandlers ( bool  use_shared_handlers)

Definition at line 345 of file ossimMultiThreadSequencer.cpp.

References d_useSharedHandlers, m_inputChain, ossimImageChainMtAdaptor::setUseSharedHandlers(), and ossimRefPtr< T >::valid().

Referenced by loadState().

346 {
347  d_useSharedHandlers = use_shared_handlers;
348 
349  if (m_inputChain.valid())
350  m_inputChain->setUseSharedHandlers(use_shared_handlers);
351 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageChainMtAdaptor > m_inputChain
Same as base class&#39; theInputConnection.
void setUseSharedHandlers(bool use_shared_handlers)

Friends And Related Function Documentation

◆ ossimGetTileJob

friend class ossimGetTileJob
friend

Definition at line 97 of file ossimMultiThreadSequencer.h.

Member Data Documentation

◆ d_cacheEmptyCount

ossim_uint32 ossimMultiThreadSequencer::d_cacheEmptyCount

Definition at line 59 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), and ossimIgen::outputProduct().

◆ d_cacheTileSize

ossim_uint32 ossimMultiThreadSequencer::d_cacheTileSize

Definition at line 69 of file ossimMultiThreadSequencer.h.

Referenced by setCacheTileSize(), and setToStartOfSequence().

◆ d_debugEnabled

bool ossimMultiThreadSequencer::d_debugEnabled
protected

◆ d_idleTime1

double ossimMultiThreadSequencer::d_idleTime1

Definition at line 60 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile().

◆ d_idleTime2

double ossimMultiThreadSequencer::d_idleTime2

Definition at line 61 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), and ossimIgen::outputProduct().

◆ d_idleTime3

double ossimMultiThreadSequencer::d_idleTime3

Definition at line 62 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile().

◆ d_idleTime4

double ossimMultiThreadSequencer::d_idleTime4

Definition at line 63 of file ossimMultiThreadSequencer.h.

Referenced by setTileInCache().

◆ d_idleTime5

double ossimMultiThreadSequencer::d_idleTime5

Definition at line 64 of file ossimMultiThreadSequencer.h.

Referenced by nextJob(), and ossimIgen::outputProduct().

◆ d_idleTime6

double ossimMultiThreadSequencer::d_idleTime6

Definition at line 65 of file ossimMultiThreadSequencer.h.

Referenced by nextJob().

◆ d_jobGetTileT

double ossimMultiThreadSequencer::d_jobGetTileT

Definition at line 66 of file ossimMultiThreadSequencer.h.

Referenced by ossimIgen::outputProduct(), and setTileInCache().

◆ d_maxCacheUsed

ossim_uint32 ossimMultiThreadSequencer::d_maxCacheUsed

Definition at line 58 of file ossimMultiThreadSequencer.h.

Referenced by ossimIgen::outputProduct(), and setTileInCache().

◆ d_printMutex

std::mutex ossimMultiThreadSequencer::d_printMutex
mutableprotected

Definition at line 142 of file ossimMultiThreadSequencer.h.

Referenced by print().

◆ d_t1

double ossimMultiThreadSequencer::d_t1
protected

Definition at line 147 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), nextJob(), and setTileInCache().

◆ d_timedBlocksDt

ossim_uint32 ossimMultiThreadSequencer::d_timedBlocksDt
protected

Definition at line 145 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), and nextJob().

◆ d_timeMetricsEnabled

bool ossimMultiThreadSequencer::d_timeMetricsEnabled
protected

Definition at line 146 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), nextJob(), and setTileInCache().

◆ d_timerMutex

std::mutex ossimMultiThreadSequencer::d_timerMutex
mutableprotected

Definition at line 143 of file ossimMultiThreadSequencer.h.

◆ d_useCache

bool ossimMultiThreadSequencer::d_useCache

Definition at line 70 of file ossimMultiThreadSequencer.h.

Referenced by setToStartOfSequence(), and setUseCache().

◆ d_useSharedHandlers

bool ossimMultiThreadSequencer::d_useSharedHandlers

Definition at line 68 of file ossimMultiThreadSequencer.h.

Referenced by setToStartOfSequence(), and setUseSharedHandlers().

◆ m_cacheMutex

std::mutex ossimMultiThreadSequencer::m_cacheMutex
mutableprotected

Definition at line 135 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), nextJob(), and setTileInCache().

◆ m_callback

std::shared_ptr<ossimGetTileCallback> ossimMultiThreadSequencer::m_callback
protected

◆ m_getTileBlock

ossim::Block ossimMultiThreadSequencer::m_getTileBlock
protected

◆ m_inputChain

ossimRefPtr<ossimImageChainMtAdaptor> ossimMultiThreadSequencer::m_inputChain
protected

◆ m_jobMtQueue

std::shared_ptr<ossimJobMultiThreadQueue> ossimMultiThreadSequencer::m_jobMtQueue
protected

◆ m_jobMutex

std::mutex ossimMultiThreadSequencer::m_jobMutex
mutableprotected

Definition at line 136 of file ossimMultiThreadSequencer.h.

Referenced by nextJob().

◆ m_maxCacheSize

ossim_uint32 ossimMultiThreadSequencer::m_maxCacheSize
protected

Definition at line 133 of file ossimMultiThreadSequencer.h.

Referenced by nextJob(), setNumberOfThreads(), and setToStartOfSequence().

◆ m_maxTileCacheFactor

ossim_uint32 ossimMultiThreadSequencer::m_maxTileCacheFactor
protected

Definition at line 134 of file ossimMultiThreadSequencer.h.

Referenced by setNumberOfThreads(), and setToStartOfSequence().

◆ m_nextJobBlock

ossim::Block ossimMultiThreadSequencer::m_nextJobBlock
protected

Definition at line 139 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), and nextJob().

◆ m_nextTileID

ossim_uint32 ossimMultiThreadSequencer::m_nextTileID
protected

ID of next tile to be threaded, different from base class' theCurrentTileNumber.

Definition at line 131 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), nextJob(), setNumberOfThreads(), and setToStartOfSequence().

◆ m_numThreads

ossim_uint32 ossimMultiThreadSequencer::m_numThreads
protected

Definition at line 129 of file ossimMultiThreadSequencer.h.

Referenced by setNumberOfThreads(), and setToStartOfSequence().

◆ m_tileCache

TileCache ossimMultiThreadSequencer::m_tileCache
protected

Saves tiles output by threaded jobs.

Definition at line 132 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), nextJob(), and setTileInCache().

◆ m_totalNumberOfTiles

ossim_uint32 ossimMultiThreadSequencer::m_totalNumberOfTiles
protected

Definition at line 137 of file ossimMultiThreadSequencer.h.

Referenced by getNextTile(), nextJob(), and setToStartOfSequence().


The documentation for this class was generated from the following files: