Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Atomic and Generics. Awkward to use and relatively unknown but c11 introduced them


How do atomics help a high-level graphics API? The implementation can use them, but threading probably shouldn't be part of the interface.

Generics are cool, but auxiliary to any core part of the api since it's not really possible to use them outside of in a macro that wraps over a real function.


Can't you (ie the programmer) still use them though? You can write C11 code which freely calls the C99 API. By using C99 the API is compatible with a wider range of compilers and callable from a broader range of languages.

(Also where would the API itself have benefited in any significant way from the use of atomics or generics? Recall that compiler support for atomics is optional in C11.)


Generic could help but that could be just a wrapper over the main api.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: