salezica
salezica

Reputation: 76949

Testing concurrent data structures

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.

Upvotes: 13

Views: 959

Answers (1)

markgz
markgz

Reputation: 6266

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.

Upvotes: 4

Related Questions