comparison data/fft/FFTDataServer.cpp @ 159:e5879045d22b

* Pull memory cache out into its own file
author Chris Cannam
date Wed, 16 Aug 2006 14:59:09 +0000
parents c03ec31005e1
children 04baa690f90d
comparison
equal deleted inserted replaced
158:74abef65711b 159:e5879045d22b
14 */ 14 */
15 15
16 #include "FFTDataServer.h" 16 #include "FFTDataServer.h"
17 17
18 #include "FFTFileCache.h" 18 #include "FFTFileCache.h"
19 #include "FFTMemoryCache.h"
19 20
20 #include "model/DenseTimeValueModel.h" 21 #include "model/DenseTimeValueModel.h"
21 22
22 #include "system/System.h" 23 #include "system/System.h"
23 24
485 486
486 FFTCache *cache = new FFTFileCache(name, MatrixFile::ReadWrite, 487 FFTCache *cache = new FFTFileCache(name, MatrixFile::ReadWrite,
487 m_polar ? FFTFileCache::Polar : 488 m_polar ? FFTFileCache::Polar :
488 FFTFileCache::Rectangular); 489 FFTFileCache::Rectangular);
489 490
491 // FFTCache *cache = new FFTMemoryCache();
492
490 size_t width = m_cacheWidth; 493 size_t width = m_cacheWidth;
491 if (c * m_cacheWidth + width > m_width) { 494 if (c * m_cacheWidth + width > m_width) {
492 width = m_width - c * m_cacheWidth; 495 width = m_width - c * m_cacheWidth;
493 } 496 }
494 497
742 std::cerr << "FFTDataServer(" << this << "): suspended, waiting..." << std::endl; 745 std::cerr << "FFTDataServer(" << this << "): suspended, waiting..." << std::endl;
743 #endif 746 #endif
744 m_server.m_writeMutex.lock(); 747 m_server.m_writeMutex.lock();
745 m_server.m_condition.wait(&m_server.m_writeMutex, 10000); 748 m_server.m_condition.wait(&m_server.m_writeMutex, 10000);
746 m_server.m_writeMutex.unlock(); 749 m_server.m_writeMutex.unlock();
750 #ifdef DEBUG_FFT_SERVER
751 std::cerr << "FFTDataServer(" << this << "): waited" << std::endl;
752 #endif
747 if (m_server.m_exiting) return; 753 if (m_server.m_exiting) return;
748 } 754 }
749 755
750 if (++counter == updateAt) { 756 if (++counter == updateAt) {
751 m_extent = f; 757 m_extent = f;