|
发表于 2009-11-11 16:09:44
|
显示全部楼层
在ACE_Dev_Poll_Reactor::dispatch_io_event中找到了这段:
/* When using sys_epoll, we can attach arbitrary user
data to the descriptor, so it can be delivered when
activity is detected. Perhaps we should store event
HANDLER TOGETHER WITH DESCRIPTOR, INSTEAD OF LOOKING
it up in a repository ? Could it boost performance ?
*/
可惜好的想法提出来后,这么多版本过去了还是没有实现。奇怪ACE开发人员的主要精力都放在那些方面了?
epoll_data的定义如下:
{
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
如果不用fd,而是用ptr指向对应的event_handler,就可以实现设想的性能改进。不再需要查数据库(repository),wait到event后直接调用handler就可以了。 |
|