well i have do syncronize a little. i have 2 pointers, when the read in thread is reading into the first pointer the display thread is using the 2nd pointer. and vise versa.
My frame rate is 30 frames per second.....oh wait........ OMG so thats wat i was doing wrong! inside my while loop i have...
>>Are you using WaitForSingleObject() with an event from CreateEvent()?
Yup, thats wat i'm using. and i am signaling it.
>>Are you using a CRITICAL_SECTION to synchronized access to the memory bock?
Nope. I allocated the memeory for the pointer before i create the thread.
I c wat ur sayin...
thnx, i'll try ur solution jfmclemore.
and palbano i think i get what ur saying.(or maybe not i'm somewhat a beginner)i don't know if this is wat u mean but my thread has a while loop
int thread()
{
while(exit==false)
{
read in from file
copy data to pointer
wait for event
}...
In thread 1 is reading in from a file and placin the data in a pointer. Thread 2 is using the info from the pointer to display image frames using direct draw.
The main problem with using the boolean thing is that when i tell it to end it dosn't end right away. it continues for a few seconds...
Hi, I'm working with threading and i'm having a little trouble exiting the threads.
I start up two threads using CreateThread.
The program runs, now i wish to stop the threads.
So the program is something like this
load program
create thread 1
create thread 2
wait for msg
if user clicks...
Hey, Sorry if I was unclear, but i have fixed my error. It turns out if i set the no buffer flag i can only use increments of 512(harddrive sector size). Thanks for all the help.
Hi, i'm currently using the CreateFile and ReadFile functions in my program. I need to read in large chunks of data really fast. But i'm having some trouble with the functions.
videoYUV=CreateFile("C:\\Documents and Settings\\mliu\\Desktop\\YUVPLAYER\\pond.yuv", GENERIC_READ...
Hi, I'm trying to use an array to hold some information from a file. Here is my code.
byte * buffer[30];
for(int j=0;j<30;i++)
{
buffer[j]=(byte *)malloc(518400);
}
//then i open a file-this part has no problems
ReadFile(videoYUV,buffer[1],518400,&bytesread,&gOverLapped);
The read in...
Hi, I currenty looking at making a multimedia player which plays DV format videos. I have been experimenting with different ways to read in the file. i.e fread, ReadFile, mmioRead.
But these functions seem to have trouble when it comes to large files(currently using a 300 meg file for testing)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.