Example #1
0
STDMETHODIMP HostWrap::COMGETTER(ProcessorCount)(ULONG *aProcessorCount)
{
    LogRelFlow(("{%p} %s: enter aProcessorCount=%p\n", this, "Host::getProcessorCount", aProcessorCount));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aProcessorCount);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getProcessorCount(aProcessorCount);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aProcessorCount=%RU32 hrc=%Rhrc\n", this, "Host::getProcessorCount", *aProcessorCount, hrc));
    return hrc;
}
BigRealResourcePool::BigRealResourcePool() {
  m_gate.wait();

  m_processorCount = getProcessorCount();
  CompactArray<DigitPool*> poolArray;
  for(int i = 0; i < 8; i++) {
    poolArray.add(m_digitPool.fetchResource());
  }
  for(size_t i = 0; i < poolArray.size(); i++) {
    m_digitPool.releaseResource(poolArray[i]);
  }
  m_activeThreads  = m_maxActiveThreads = 1;
  m_gate.signal();
}
Example #3
0
int main( int argc, char ** argv )
{
    QApplication app( argc, argv );


#if _MSC_VER || __MINGW32__
	MEMORYSTATUSEX statex;
	statex.dwLength = sizeof (statex);
	GlobalMemoryStatusEx (&statex);
	printf ("There are %d total Mbytes of virtual memory.\n", statex.ullTotalVirtual/(1024*1024));
	printf ("There are %d free Mbytes of virtual memory.\n", statex.ullAvailVirtual/(1024*1024));
#endif
#if _MSC_VER
	omp_set_num_threads(getProcessorCount());
#endif
    RtiViewerDlg *maindlg = new RtiViewerDlg();
    maindlg->show();
	FileOpenEater *filterObj = new FileOpenEater(maindlg);
	app.installEventFilter(filterObj);
	app.processEvents();
	if (argc > 1)
		maindlg->openFile(QString(argv[1]));
	return app.exec();
}