|
Page Created :
qpid :
CppEventChannelIo
CppEventChannelIo has been created by Alan Conway (Nov 06, 2006). Content:Event channel IO abstraction.Goals: provide an IO abstraction layer that can be efficiently implemented using differente techniques:
The event channel is the central IO absctraction. Async requests are posted to the channel as Events. When the request is complete it is returned from getEvent() with the data filled in. We provide synchronous APIs to wrap post(event), wait for getEvent(). On posix these APIs are actually implemented using user-level context swithching so we get a simple programing model with minimal blocking and kernel context switching. Note: this means that code before and after an apparently synchronous call ''may execute in different threads''. Don't use thread-local We can provide some simple in-process synchronization via the event channel to allow use level tasks to block on application events. Core concepts:EventChannel:
Task:
Linux ec_ + ucontext implementation:
Linux epoll + ucontext:
APR portable impl: only need client support - simple blocking socket calls. Computing thread pool size:
ThreadPool: Size should stay close to actuall hardware paralellism + some delta due to pre-empted threads and thread-blocking Questions:
|
Unsubscribe or edit your notifications preferences
