18,356
社区成员
发帖
与我相关
我的任务
分享
while (TRUE)
{
#if defined(WIN32)
if(kbhit())
{
int ch = 0;
while(kbhit())
ch = getch();
if(ch == 'Q' || ch == 'q')
break;
}
#endif
}
但是,这个应该不影响工作线程的执行吧?
有没有可能是工作线程睡眠了?在网络iocp服务这块,你们碰到过类似的问题吗?
DWORD WINAPI thread_proc(LPVOID lpParam)
{
while(1)
{
aio_socket_process(INFINITE);
}
return 1;
}
int aio_socket_process(int timeout)
{
BOOL status;
DWORD bytes;
ULONG completionKey;
OVERLAPPED *pOverlapped;
struct aio_context *ctx;
struct aio_context_action *aio;
status = GetQueuedCompletionStatus(s_iocp, &bytes, &completionKey, &pOverlapped, timeout);
if(status)
{}
}
when one AcceptEx returned , another new will be post.