C99 and multithreading

So, I’ve started reading the Vulkan reference manual, because I’m an RFTM-guy. I found it curious but also pleasantly surprising that it says that “Vulkan is a C99 API […]”. I love C, so that’s definitely not a problem for me. But then I read three pages later that “Multiple command buffers can be built in parallel by employing multiple threads within the application.”. Multi-threading first came in C11.

I’m curious!

The language specification may only consider multi threading since C11, but it’s certainly been in use way before the spec acknowledged the existence of more than one thread of execution :wink:
That being said I don’t see the contradiction; you are not required to use multiple threads to record command buffers (or do anything else in Vulkan for that matter), so the API itself is perfectly usable in C99. If you want to use multiple threads to build your command buffers that is your applications choice and if you don’t like the being outside the C specification your application’s requirements may be higher than Vulkan’s.

Ah, that makes sense. I’m rather new to C, and didn’t know that you could do multi-threading with C99.

Of course, it doesn’t say the application must use multi-threading for command buffers, I got that much. It’s just that it doesn’t really makes sense to say that it could if it was possible, which it wouldn’t be if multi-threading only was possible in C11 and after.

But I’m still curious why the choice fell on writing C99, when it seemingly is severely rare that anyone use C99 only for the application. Why not just write C/C++?

It states the minimum required version of C to use the API; my guess would be it is C99 because that is when the fixed size integer types (e.g. uint32_t) where added, which are used in many function signatures and structures.

Hmm, that makes sense, but then it’d have to be written differently. The sentence itself basically says that it’s exclusively C99.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.