Click here to Skip to main content
15,914,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReceive messages in dialog based application through socket Pin
Mushtaque Nizamani27-Jun-08 20:50
Mushtaque Nizamani27-Jun-08 20:50 
QuestionCompare two strings Pin
manju#12327-Jun-08 20:49
manju#12327-Jun-08 20:49 
GeneralRe: Compare two strings Pin
CPallini27-Jun-08 21:48
mveCPallini27-Jun-08 21:48 
GeneralRe: Compare two strings Pin
manju#12327-Jun-08 21:50
manju#12327-Jun-08 21:50 
GeneralRe: Compare two strings Pin
CPallini27-Jun-08 21:55
mveCPallini27-Jun-08 21:55 
GeneralRe: Compare two strings Pin
manju#12327-Jun-08 22:42
manju#12327-Jun-08 22:42 
AnswerRe: Compare two strings Pin
Ștefan-Mihai MOGA28-Jun-08 3:56
professionalȘtefan-Mihai MOGA28-Jun-08 3:56 
QuestionHelp on Multi-Threaded applicaiton [modified] Pin
Kiran Satish27-Jun-08 12:48
Kiran Satish27-Jun-08 12:48 
Hi,
I am having an application where we mainly do analysis on images being grabbed in real-time. The current version basically works in the following way- Loop[^]

the critical section code within writing into shared buffer looks as follows
// Critical section of code<br />
CCriticalSection CritSect;<br />
CritSect.Lock();<br />
// Copy into shared memory<br />
memcpy(SharedBuffer, cap_buffer, FrameSize);<br />
Timestamp_FrameWrite = LoopStart->GetTimeDiff(); //"frame write"<br />
CritSect.Unlock();

and the code within reading frame is as follows
// Critical section of code<br />
CCriticalSection CritSect;<br />
CritSect.Lock();<br />
// Copy from shared memory<br />
memcpy(proc_buffer, SharedBuffer, FrameSize);<br />
Timestamp_FrameRead = LoopStart->GetTimeDiff(); //"frame read"<br />
CritSect.Unlock();


From the block diagram you will notice that camera thread will call the function to write the newly captured frame into shared buffer for every 20ms (since the exposure time is 20ms) and this is also verified by finding the difference between two successive "frame write" timestamps (~18ms to ~22ms). This is all fine.

Now when I find the difference between two successive "frame read" timestamps, it always gives me either ~15ms or ~31ms as shown below
15.8758<br />
15.6622<br />
31.008<br />
15.845<br />
15.605<br />
31.062<br />
15.819<br />
15.663<br />
15.748

but when you average these over total number of frames read, it give ~20ms which shows that it is not dropping frames while reading (in other words its analyzing all frames being captured). So, the question is why is the "frame read" timestamp doesnt correspond to frame rate (i.e ~20ms or ~49Hz), this is the same case even when I am not doing any analysis (which hardly takes more than 10msec)?? I have to say that the loop function runs on a TIMER which has 5msec timeout value.

-thanks

PKNT

AnswerRe: Help on Multi-Threaded applicaiton Pin
Saurabh.Garg27-Jun-08 18:23
Saurabh.Garg27-Jun-08 18:23 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish27-Jun-08 19:02
Kiran Satish27-Jun-08 19:02 
AnswerRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery28-Jun-08 9:15
Mark Salsbery28-Jun-08 9:15 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish28-Jun-08 12:52
Kiran Satish28-Jun-08 12:52 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery28-Jun-08 12:59
Mark Salsbery28-Jun-08 12:59 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish28-Jun-08 13:24
Kiran Satish28-Jun-08 13:24 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery28-Jun-08 15:31
Mark Salsbery28-Jun-08 15:31 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish28-Jun-08 15:37
Kiran Satish28-Jun-08 15:37 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery28-Jun-08 16:16
Mark Salsbery28-Jun-08 16:16 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish28-Jun-08 16:21
Kiran Satish28-Jun-08 16:21 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery29-Jun-08 7:03
Mark Salsbery29-Jun-08 7:03 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery29-Jun-08 7:26
Mark Salsbery29-Jun-08 7:26 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish29-Jun-08 8:33
Kiran Satish29-Jun-08 8:33 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery29-Jun-08 8:48
Mark Salsbery29-Jun-08 8:48 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish30-Jun-08 10:36
Kiran Satish30-Jun-08 10:36 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery30-Jun-08 10:53
Mark Salsbery30-Jun-08 10:53 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish30-Jun-08 11:00
Kiran Satish30-Jun-08 11:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.