How can you practically test a synchronized data structure (in C)?
Firing a couple of threads and have them compete for access to the structure for a while to see if anything goes wrong doesn't sound very safe.
EDIT in response to comments: I mean that there are several threads running functions that operate on the same set of data, with some kind of synchronization strategy (flags/semaphores/lock-free CAS/etc) to presumably eliminate race conditions and deadlocks. The problem is programatically testing for the correct synchronization of the workers.
Concurrency testing is a type of software testing that checks the performance of software when multiple users are logged in and perform actions simultaneously. Hence, it is also referred to as multi-user testing.
In computer science, a concurrent data structure is a particular way of storing and organizing data for access by multiple computing threads (or processes) on a computer.
Concurrent data structures permit many threads to operate on common data using a high-level interface. When a data structure is accessed concurrently by many threads, its semantics are typically defined by a property called linearizability,8 which provides strong consistency.
No-one really knows how to do this with 100% reliability. Here is just one example of of a testing tool to find concurrency bugs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With