base¶
Small building blocks every module uses. It is the lowest layer of the project: it includes only the standard
library, and platform/ is the only folder of the project allowed to include operating-system headers.
Folders¶
Folder |
What it holds |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Arrow C Data Interface structures, |
|
|
Rules a user of base must know¶
Determinism.
parallelFor(pool, count, pieceSize, body)splits[0, count)into pieces ofpieceSize; choosepieceSizefrom the work (a named constant or a function ofcount), never frompool->threadCount(). Write only the part of the result a piece owns; combine partial results withparallelReduce, which combines them in piece order. Then the bits of a result do not depend on the number of threads.Cancellation. Pass a
CancellationToken*toparallelFor,parallelReduceorTaskGraph::run: pieces not started are skipped andOperationCancelledErroris thrown. A piece must stay well under 0.1 s of work, or check the token itself. A long operation takes anOperationControl(token and progress counter) and says the unit it advances the counter by.Errors in parallel work. The exception of the lowest task or piece index is rethrown, so the error a user sees does not depend on the timing either.
Memory. A buffer whose size grows with the model is a
BudgetedBuffer; its size is reserved before anything is allocated. The budget must outlive its reservations and buffers.Arrow. A
ContractReaderowns its table; the views it returns are valid as long as the reader lives. Nulls are refused unless the caller passesNullPolicy::Allowand readsvalidity().
Where to start reading¶
errors/SolverError.hpp, then threading/ParallelFor.hpp and memory/BudgetedBuffer.hpp, then
arrow/ContractReader.hpp.