Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
symbian::concurrency::WorkerExecutor Class Reference

Bounded work destination on one guest OS thread. More...

#include <cpp/symbian/concurrency/guest/symbian/concurrency/worker_executor.h>

Classes

class  DispatchHandle
 
struct  State
 

Public Types

using Work = absl::AnyInvocable< void() && >
 

Public Member Functions

 WorkerExecutor (std::size_t max_outstanding=128)
 
 WorkerExecutor (const WorkerExecutor &)=delete
 
WorkerExecutor & operator= (const WorkerExecutor &)=delete
 
 ~WorkerExecutor ()
 
DispatchHandle handle () const
 
absl::Status Post (Work work)
 Enqueue stackless work on the single worker thread.
 
Task PostFiber (Work work, std::size_t stack_bytes=16 *1024)
 Run one job on a bounded guest fiber hosted by this worker.
 
void Close ()
 Stop accepting work while queued jobs continue to drain.
 
Task Finish ()
 Close and return a task that completes after all jobs drain.
 

Detailed Description

Bounded work destination on one guest OS thread.

Use for operations too long for the event thread. Post executes without a fiber; PostFiber schedules a job on the worker's A11-derived fiber scheduler. The admission limit counts queued and active jobs. Close does not block the event thread; Finish reports drainage.

Member Typedef Documentation

◆ Work

Constructor & Destructor Documentation

◆ WorkerExecutor() [1/2]

symbian::concurrency::WorkerExecutor::WorkerExecutor ( std::size_t  max_outstanding = 128)
explicit

◆ WorkerExecutor() [2/2]

symbian::concurrency::WorkerExecutor::WorkerExecutor ( const WorkerExecutor &  )
delete

◆ ~WorkerExecutor()

symbian::concurrency::WorkerExecutor::~WorkerExecutor ( )

Member Function Documentation

◆ Close()

void symbian::concurrency::WorkerExecutor::Close ( )

Stop accepting work while queued jobs continue to drain.

◆ Finish()

Task symbian::concurrency::WorkerExecutor::Finish ( )

Close and return a task that completes after all jobs drain.

◆ handle()

DispatchHandle symbian::concurrency::WorkerExecutor::handle ( ) const
inline

◆ operator=()

WorkerExecutor & symbian::concurrency::WorkerExecutor::operator= ( const WorkerExecutor &  )
delete

◆ Post()

absl::Status symbian::concurrency::WorkerExecutor::Post ( Work  work)
inline

Enqueue stackless work on the single worker thread.

◆ PostFiber()

Task symbian::concurrency::WorkerExecutor::PostFiber ( Work  work,
std::size_t  stack_bytes = 16 * 1024 
)

Run one job on a bounded guest fiber hosted by this worker.

Use a larger stack for native libraries with deep call chains. The stack is allocated only for the live job and may be 4 KiB to 1 MiB, aligned to a machine word. Admission still uses max_outstanding.


The documentation for this class was generated from the following files: