#include <corelib/ncbitime.hpp>
Include dependency graph for ncbi_system.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Typedefs | |
| typedef void * | TLimitsPrintParameter |
| Type of parameter for print handler. | |
| typedef void(* | TLimitsPrintHandler )(ELimitsExitCode, size_t, CTime &, TLimitsPrintParameter) |
| Type of handler for printing a dump information after generating any limitation event. | |
| typedef int | TSuppressSystemMessageBox |
| Binary OR of "ESuppressSystemMessageBox". | |
Enumerations | |
| enum | ELimitsExitCode { eLEC_None, eLEC_Memory, eLEC_Cpu } |
| Code for program's exit handler. More... | |
| enum | ESuppressSystemMessageBox { fSuppress_System = (1<<0), fSuppress_Runtime = (1<<1), fSuppress_Debug = (1<<2), fSuppress_Exception = (1<<3), fSuppress_All, fSuppress_Default = fSuppress_All } |
| Suppress modes. More... | |
Functions | |
| bool | SetHeapLimit (size_t max_heap_size, TLimitsPrintHandler handler=0, TLimitsPrintParameter parameter=0) |
| [UNIX only] Set memory limit. | |
| bool | SetCpuTimeLimit (size_t max_cpu_time, TLimitsPrintHandler handler=0, TLimitsPrintParameter parameter=0, size_t terminate_time=5) |
| [UNIX only] Set CPU usage limit. | |
| unsigned int | GetCpuCount (void) |
| [UNIX & Windows] Return number of active CPUs (never less than 1). | |
| unsigned long | GetVirtualMemoryPageSize (void) |
| [UNIX & Windows] Return granularity with which virtual memory is allocated. | |
| Uint8 | GetPhysicalMemorySize (void) |
| [UNIX & Windows] Return the amount of physical memory available on the machine. | |
| bool | GetMemoryUsage (size_t *total, size_t *resident, size_t *shared) |
| [UNIX & Windows] Return current memory usage, in bytes. | |
| void | SleepSec (unsigned long sec, EInterruptOnSignal onsignal=eRestartOnSignal) |
| Sleep. | |
| void | SleepMilliSec (unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal) |
| void | SleepMicroSec (unsigned long mc_sec, EInterruptOnSignal onsignal=eRestartOnSignal) |
| void | SuppressSystemMessageBox (TSuppressSystemMessageBox mode=fSuppress_Default) |
| Suppress popup messages on execution errors. | |
| void | DisableSuppressSystemMessageBox () |
| Prevent run of SuppressSystemMessageBox(). | |
|
|
Type of handler for printing a dump information after generating any limitation event.
Definition at line 71 of file ncbi_system.hpp. |
|
|
Type of parameter for print handler.
Definition at line 67 of file ncbi_system.hpp. |
|
|
Binary OR of "ESuppressSystemMessageBox".
Definition at line 192 of file ncbi_system.hpp. |
|
|
Code for program's exit handler. If, during the program execution, the process exceed any from limits (see ELimitsExitCodeMemory) then: 1) Dump info about current program's state to log-stream.
Definition at line 60 of file ncbi_system.hpp. |
|
|
Suppress modes.
Definition at line 182 of file ncbi_system.hpp. |
|
|
Prevent run of SuppressSystemMessageBox(). NOTE: MS Windows-specific. If this function is called, all following calls of SuppressSystemMessageBox() will be ignored. If SuppressSystemMessageBox() was executed before, that this function print out a critical error message. For example can be used in CGI applications where SuppressSystemMessageBox always calls in the CCgiApplication constructor. Definition at line 708 of file ncbi_system.cpp. References ERR_POST_X. |
|
|
[UNIX & Windows] Return number of active CPUs (never less than 1).
Definition at line 376 of file ncbi_system.cpp. References len. Referenced by CThread::CThread(), CDumpSysInfo::DumpSystemInfo(), CNWAligner::EnableMultipleThreads(), CGridWorkerNode::Run(), and COMSSABase::SetThreadCount(). |
|
||||||||||||||||
|
[UNIX & Windows] Return current memory usage, in bytes. NULL arguments will not be filled in. Returns true if able to determine memory usage, and false otherwise. Definition at line 515 of file ncbi_system.cpp. References BOOL, CDll::eAutoUnload, CDll::eLoadNow, FAR, CDll::GetEntryPoint_Func(), GetVirtualMemoryPageSize(), len, and size. |
|
|
[UNIX & Windows] Return the amount of physical memory available on the machine. Return 0 if cannot determine it on current platform or if an error occurs. Definition at line 459 of file ncbi_system.cpp. References GetVirtualMemoryPageSize(), and len. |
|
|
[UNIX & Windows] Return granularity with which virtual memory is allocated. Return 0 if cannot determine it on current platform or if an error occurs. Definition at line 423 of file ncbi_system.cpp. References si. Referenced by CMemoryFile_Base::CMemoryFile_Base(), CSeqDBMapStrategy::CSeqDBMapStrategy(), GetMemoryUsage(), GetPhysicalMemorySize(), and CTar::x_Init(). |
|
||||||||||||||||||||
|
[UNIX only] Set CPU usage limit. Set the limit for the CPU time that can be consumed by current process.
Definition at line 359 of file ncbi_system.cpp. |
|
||||||||||||||||
|
[UNIX only] Set memory limit. Set the limit for the size of dynamic memory (heap) allocated by the process.
Definition at line 293 of file ncbi_system.cpp. |
|
||||||||||||
|
Definition at line 588 of file ncbi_system.cpp. References eInterruptOnSignal, errno, and kMicroSecondsPerSecond. Referenced by CRequestRateControl::Sleep(), SleepMilliSec(), SleepSec(), and CReader::WaitBeforeNewConnection(). |
|
||||||||||||
|
||||||||||||
|
Sleep. Suspend execution for a time. Sleep for at least the specified number of microsec/millisec/seconds. Time slice restrictions are imposed by platform/OS. On UNIX the sleep can be interrupted by a signal. Sleep*Sec(0) have no effect (but may cause context switches). [UNIX & Windows] Definition at line 649 of file ncbi_system.cpp. References kMicroSecondsPerSecond, and SleepMicroSec(). Referenced by BOOST_AUTO_TEST_CASE(), CSampleIdleTask::Run(), CGBenchMonitorApp::Run(), CRequestRateControl::Sleep(), and CRemoteBlast::x_PollUntilDone(). |
|
|
Suppress popup messages on execution errors. NOTE: MS Windows-specific. Suppresses all error message boxes in both runtime and in debug libraries, as well as all General Protection Fault messages. Definition at line 675 of file ncbi_system.cpp. References fSuppress_Debug, fSuppress_Exception, fSuppress_Runtime, and fSuppress_System. Referenced by CCgiApplication::CCgiApplication(), main(), and CNcbiTestApplication::x_SetupBoostReporters(). |
1.4.6
Modified on Mon Dec 07 16:21:19 2009 by modify_doxy.py rev. 173732