【问题标题】:how to create thread in C?如何在C中创建线程?
【发布时间】:2011-11-16 04:50:04
【问题描述】:

我在 Windows 中使用 Visual Studio 来开发 C 库。有人可以为我提供在 Windows 控制台应用程序中创建线程并启动它的简单示例。谢谢

【问题讨论】:

标签: c windows multithreading console-application


【解决方案1】:

这些链接可能会对您有所帮助。

Creating Threads

Thread Functions

【讨论】:

    【解决方案2】:

    C++ 和 C 不支持线程。 你必须使用 Win32 API 来支持线程,你可以用谷歌搜索,BING。

    【讨论】:

      【解决方案3】:

      对于 Windows:使用 _beginthread and _beginthreadex。 CreateThread 的 CRT 有问题。

      对于 unix:使用 pthread_create

      【讨论】:

        猜你喜欢
        • 2018-07-26
        • 2023-03-15
        • 2012-01-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-12-03
        • 2013-10-30
        • 2013-03-13
        相关资源
        最近更新 更多