Anything wrong with this in general?
CallingFunction()
{
CreatePipe()
CreateMutex()
CreateThread( ThreadFunction )
while(there is data left to send)
{
WriteFile(send data in 256 byte chunks)
}
WaitForSingleobject() //don't return until ReadThread is done
return 0;
}
ThreadFunction()
{
WaitForSinglObject()
while(bytesRead != totalBytestoReadFileSize)
{
ReadfromPipe(in chunks)
update bytesRead++
}
ReleaseMutex()
return 0;
}
Before the calling function ends -
FileSize: 232016
BytesWrittenToPipe: 232016
BytesReadFromPipe: 231946 or 232012 or 231840 -> Why not consistent?