im running code thats using threads, everytime i get this debug assertion failed box poping up.
It involves with my stl vector.
its saying that vector iterators incompatible.
the vector contains structs of data.
i have ten threads running, using the same function called "GetMemory()".
the function just looks through the function and swaps around the data in the vector list. The first ten containers in the vector are the Main Memory, and the rest of the vector list is virtual memory.
Also before it calls "GetMemory()" function it calls another function which intilise the vector with so many structs
so far its like this :
typedef struct{
int page_number;
int thread number;
int used;
} DATA;
DATA ThreadData[10] // initilised in another function
vector<struct> memory;
GetMemory( ThreadData[], int number )
{
// checks through the virtual memory
for( iter = memory.begin() + 10; iter != memory.end(); ++iter )
{
if( iter->page_number == ThreadData[ number ].page_number
&& iter -> Thread_Number == Number )
{
// does stuff in here
}
}
}
thats the first part of the code in the fucntion so far, is there any amatuer errors there? not a total expert in stl vectors or using thread command fucntion
main function()
{
create ten threads
WaitForMultipleObjects( MAX_THREADS, Thread_H, TRUE, INFINITE);
}