SipperMediaFileContent * SipperMediaFileLoader::loadFile(const std::string &filename) { SipperMediaFileContent *result = dynamic_cast<SipperMediaFileContent *>(_emptyFileHolder.getObj()); pthread_mutex_lock(&_mutex); SipperFileContentMapIt it = _contentMap.find(filename); if(it != _contentMap.end()) { SipperMediaFileContent *stored = it->second; #ifndef __UNIX__ struct _stat currstat; _stat(filename.c_str(), &currstat ); #else struct stat currstat; stat(filename.c_str(), &currstat); #endif if(currstat.st_mtime == stored->filestat.st_mtime) { result = stored; } else { _loadData(filename); it = _contentMap.find(filename); if(it != _contentMap.end()) { result = it->second; } } } else if((filename.length() > 0) && (filename != "0")) { _loadData(filename); it = _contentMap.find(filename); if(it != _contentMap.end()) { result = it->second; } } result->addRef(); pthread_mutex_unlock(&_mutex); return result; }
void TextureUploadProcessor::runLoop_() { _needRedraw = false; if( GLContext::getCurrent() != getGLContext().get( )) getGLContext()->makeCurrent(); processorInputPtr_->applyAll( CONNECTION_ID ); _checkThreadOperation(); #ifdef _ITT_DEBUG_ __itt_task_begin ( ittTextureLoadDomain, __itt_null, __itt_null, ittTextureComputationTask ); #endif //_ITT_DEBUG_ const DashRenderStatus& renderStatus = _dashTree->getRenderStatus(); if( renderStatus.getFrameID() != _currentFrameID ) { _protectUnloading.clear(); CollectVisiblesVisitor collectVisibles( _dashTree, _protectUnloading ); DFSTraversal traverser; const RootNode& rootNode = _dashTree->getDataSource()->getVolumeInformation().rootNode; traverser.traverse( rootNode, collectVisibles, renderStatus.getFrameID( )); _textureCache.setProtectList( _protectUnloading ); _currentFrameID = renderStatus.getFrameID(); } _loadData(); processorOutputPtr_->commit( CONNECTION_ID ); #ifdef _ITT_DEBUG_ __itt_task_end( ittTextureLoadDomain ); #endif //_ITT_DEBUG_ }
/* evict all dirty cachelines from last level cache */ static void cleanupCache(char* ptr) { #if defined(__x86_64__) || defined(__i386__) uint32_t cachesize = 2 * cpuid_topology.cacheLevels[cpuid_topology.numCacheLevels-1].size; printf("Cleaning LLC with %g MB\n", (double)cachesize/(1024.0 * 1024.0)); _loadData(cachesize,ptr); #else ERROR_PLAIN_PRINT(Cleanup cache is currently only available on X86 systems.); #endif }
void LoadPointLineGeometry::handleNotification(Field* field) { if (field == _clearCacheFld) { _clearCache(); return; } if (field == _addToCacheFld) { _addToCache(); return; } if (field == _numberDelimiterFld) { _cropNumberDelimiter(); } if (field == _decimalSeparatorFld) { _cropDecimalSeparator(); } if (field == _unloadFld) { _unloadData(); } else if (field == _loadFld) { _loadData(); } else if ( (_autoLoadFld->getBoolValue()) && ( (field == _filenameFld) || (field == _autoLoadFld) || (field == _filterFld) || (field == _decimalSeparatorFld) || (field == _numberDelimiterFld) || (field == _numberDelimiterSpaceFld) ) ) { _loadData(); } else // Any other parameter changed... { _unloadData(); } }