Skip to content

如何将一些原本同步的函数封装为异步,例如mysql_reaL_connect #689

Description

@Hackman1993

例如设置工作线程2,如果mysql_real_connect因网络速度慢返回缓慢,会导致线程被阻塞,工作线程就变为了1,如果两个线程都被阻塞,就会影响整体服务器性能,是否有什么方法可以将此类函数封装为异步,通过co_await等待返回?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions