First, let me say that I am very new at this. I have some code that someone else wrote (not sure I can post it). It purpose is to measure performance on multiple hard disk drives attached to a PCI RAID controller. The functions do work to control each drive, but measuring performance is driving me crazy. They are using the Query Performance function and are launching the HDD access functions from a front end program so that each thread is accessing the same function in the back end (dll). What this is doing is causing all the performance measurements to be exactly the same for each drive.
One solution I came up with was to name each thread with the pci index number, for example (SeekTest1, SeekTest2,...). Then in the back end, test for the name and have separate variable for each.
if(thread->Name == "SeekTest1")
Test and update the variables for pci slot 1 and return.
That works to get correct performance values for each slot. But it sort of forces the access to each slot one by one. What I really want to do is run the tests concurrently AND have the correct performance values returned. Maybe that's too much to ask.
How do I launch the back end function as an individual thread that can keep track of the individual performance values and test each drive concurrently?
To be clear, the front end is launching a back end thread for each slot, which then launches the function based on the PCI card installed.
SeekTest(pci) x 8
SeekTestHiPoint (pci) or SeekTestSiliconImage(pci)
I hope this makes sense.