Click here to Skip to main content
13,768,880 members

C / C++ / MFC

 
AnswerRe: The mismatch between Print preview and the real printing Pin
Richard MacCutchan12-Sep-18 1:57
protectorRichard MacCutchan12-Sep-18 1:57 
GeneralRe: The mismatch between Print preview and the real printing Pin
Member 1388734912-Sep-18 3:03
memberMember 1388734912-Sep-18 3:03 
GeneralRe: The mismatch between Print preview and the real printing Pin
leon de boer12-Sep-18 8:05
memberleon de boer12-Sep-18 8:05 
GeneralRe: The mismatch between Print preview and the real printing Pin
Member 1388734912-Sep-18 22:07
memberMember 1388734912-Sep-18 22:07 
GeneralRe: The mismatch between Print preview and the real printing Pin
leon de boer13-Sep-18 1:47
memberleon de boer13-Sep-18 1:47 
GeneralRe: The mismatch between Print preview and the real printing Pin
Member 1388734913-Sep-18 4:18
memberMember 1388734913-Sep-18 4:18 
GeneralRe: The mismatch between Print preview and the real printing Pin
leon de boer13-Sep-18 6:29
memberleon de boer13-Sep-18 6:29 
QuestionThread synchronization problem Pin
samzcs10-Sep-18 10:12
membersamzcs10-Sep-18 10:12 
Hi, I met a thread synchronization scenario in a small code.
//task A: 
if (rcvd == true)  
{
  read rcv_buffer
   ...
  rcvd = false;
}

//task B:
dataCB(int ch_id, char *buf, int len, char stat)
{
  rcvd = true;
  receivenotify(chid, rcv_buffer, sizeof(rcv_buffer), dataCB,0);
}


here, rcvd = false in task A, can't stop task B produce data. how can I let task A, B synchronized.
add if (rcvd == false) in task B before receivenotify()? is that a dead lock ?

Thanks
AnswerRe: Thread synchronization problem Pin
Richard Andrew x6410-Sep-18 10:35
professionalRichard Andrew x6410-Sep-18 10:35 
GeneralRe: Thread synchronization problem Pin
samzcs10-Sep-18 11:09
membersamzcs10-Sep-18 11:09 
GeneralRe: Thread synchronization problem Pin
Richard Andrew x6410-Sep-18 11:11
professionalRichard Andrew x6410-Sep-18 11:11 
GeneralRe: Thread synchronization problem Pin
samzcs10-Sep-18 11:28
membersamzcs10-Sep-18 11:28 
QuestionRe: Thread synchronization problem Pin
CPallini10-Sep-18 22:02
mvpCPallini10-Sep-18 22:02 
AnswerRe: Thread synchronization problem Pin
samzcs11-Sep-18 3:45
membersamzcs11-Sep-18 3:45 
GeneralRe: Thread synchronization problem Pin
CPallini11-Sep-18 4:23
mvpCPallini11-Sep-18 4:23 
AnswerRe: Thread synchronization problem Pin
leon de boer10-Sep-18 23:08
memberleon de boer10-Sep-18 23:08 
GeneralRe: Thread synchronization problem Pin
samzcs11-Sep-18 3:50
membersamzcs11-Sep-18 3:50 
GeneralRe: Thread synchronization problem Pin
leon de boer11-Sep-18 6:05
memberleon de boer11-Sep-18 6:05 
GeneralRe: Thread synchronization problem Pin
11917640 Member 11-Sep-18 20:53
member11917640 Member 11-Sep-18 20:53 
GeneralRe: Thread synchronization problem Pin
samzcs12-Sep-18 9:12
membersamzcs12-Sep-18 9:12 
GeneralRe: Thread synchronization problem Pin
leon de boer12-Sep-18 19:31
memberleon de boer12-Sep-18 19:31 
GeneralRe: Thread synchronization problem Pin
11917640 Member 12-Sep-18 19:58
member11917640 Member 12-Sep-18 19:58 
AnswerRe: Thread synchronization problem Pin
«_Superman_»23-Sep-18 23:26
professional«_Superman_»23-Sep-18 23:26 
QuestionBreak when address reading Pin
Member 130813699-Sep-18 16:47
memberMember 130813699-Sep-18 16:47 
AnswerRe: Break when address reading Pin
Victor Nijegorodov10-Sep-18 3:04
memberVictor Nijegorodov10-Sep-18 3:04 

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.


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.181117.1 | Last Updated 18 Nov 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid