I'm asking this question because I learned about implementing thread-safe, dynamically resizable arrays in C from a book, where it was presented as an essential topic for understanding advanced c programing and concurrency control.
Loading
I'm asking this question because I learned about implementing thread-safe, dynamically resizable arrays in C from a book, where it was presented as an essential topic for understanding advanced c programing and concurrency control.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Aman GuptaPosted Jul 2, 2024, 12:50 PM
Hi Himaja,
In C, you can use pthreads for threading and synchronization. Here's a simple implementation:
In C++, you can use the
std::vectorfor dynamic arrays andstd::mutexfor synchronization.