Threading in C, cross platform

后端 未结 8 854
情话喂你
情话喂你 2021-02-05 14:40

I am dealing with an existing project (in C) that is currently running on a single thread, and we would like to run on multiple platforms AND have multiple threads. Hopefully, t

8条回答
  •  无人及你
    2021-02-05 15:20

    Try OpenMP API, it's multi-platform and you can compile it with GCC.

    Brief description from the wikipedia:

    OpenMP (Open Multi-Processing) is an application programming interface (API) that supports multi-platform shared memory multiprocessing programming in C, C++, and Fortran,[3] on most platforms, processor architectures and operating systems, including Solaris, AIX, HP-UX, Linux, macOS, and Windows. It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior.

提交回复
热议问题