Hi,
I wrote a thread-safe(at least the aim is that) container class in C++. I lock mutexes while accessing the member and release when finished. Now, I try to write a test case if it is really thread safe. Let's say, I have Container container and two threads Thread1 Thread2.
Container container;
Thread1()
{
//Add N items to the container
}
Thread2()
{
//Add N items to the container
}
In this way, it works with no problem with N=1000.
But I'm not sure this regression test is enough or not. Is there a deterministic way to test a class like that?
Thanks.