Cross-platform multithreading in C will be fun. While the author doesn’t plan to start own threads, they do plan to use less-than-pointer handles, which means some sort of a lookup table and thus synchronization.
they do plan to use less-than-pointer handles, which means some sort of a lookup table and thus synchronization
Theoretically that doesn’t have to be the case (but probably is). It’s possible that the library will use one block of memory (or one per type) and use those handles to index into that. In such case no synchronization primitives would be needed when accessing such objects since the conversion to real pointer is just base pointer and handle addition. Considering that the author talks about pinning I doubt that they will go with such approach.
I’ve shared this mainly because I find interesting that the project is moving from C++ to C.
Cross-platform multithreading in C will be fun. While the author doesn’t plan to start own threads, they do plan to use less-than-pointer handles, which means some sort of a lookup table and thus synchronization.
Theoretically that doesn’t have to be the case (but probably is). It’s possible that the library will use one block of memory (or one per type) and use those handles to index into that. In such case no synchronization primitives would be needed when accessing such objects since the conversion to real pointer is just base pointer and handle addition. Considering that the author talks about pinning I doubt that they will go with such approach.