- 论坛徽章:
- 0
|
回复 12# py
coro的名称就是协程(coroutine),类似elang和stackless
我理解coro本身并不是非阻塞,而是只是因为coro可以极大地并行,一定条件下可以通过并行的方式来消除堵塞。
但是也要求协程内部的操作不能是互相会阻塞的。否则一个协程会阻塞其他的协程。
对POE::Component::Generic的实现有些好奇,说明很神奇
POE::Component::Generic is a POE component that provides a non-blocking wrapper around any object.
按它的说明,是通过子进程的封装实现的? 那样的话,就没什么意义了。无阻塞是要在同一进程内部才有意义的。
POE::Component::Generic works by forking a child process with POE::Wheel::Run and creating the blocking object in the child process. Method calls on the object are then serialised and sent to the child process to be handled by the object there. The returned value is serialised and sent to the parent process, where it is posted back to the caller as a POE event.
继续看....
比较头疼读源码。
现在要实现一个大批量telnet登录上万台设备/主机执行命令的功能
请教用什么方法比较好呢?
|
|