Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PROGRAM HELP!!!!!!! Pin
Cedric Moonen14-Sep-04 4:38
Cedric Moonen14-Sep-04 4:38 
GeneralRe: PROGRAM HELP!!!!!!! Pin
Hardy_Smith14-Sep-04 4:38
Hardy_Smith14-Sep-04 4:38 
GeneralRe: PROGRAM HELP!!!!!!! Pin
David Crow14-Sep-04 5:07
David Crow14-Sep-04 5:07 
GeneralRe: PROGRAM HELP!!!!!!! Pin
ISUstudent14-Sep-04 6:03
ISUstudent14-Sep-04 6:03 
GeneralThread Safe Linked List Pin
Member 3413714-Sep-04 3:12
Member 3413714-Sep-04 3:12 
GeneralRe: Thread Safe Linked List Pin
Alexander M.,14-Sep-04 3:27
Alexander M.,14-Sep-04 3:27 
GeneralRe: Thread Safe Linked List Pin
16-Sep-04 0:51
suss16-Sep-04 0:51 
GeneralRe: Thread Safe Linked List Pin
Joaquín M López Muñoz14-Sep-04 3:33
Joaquín M López Muñoz14-Sep-04 3:33 
You can safely eliminate the CRITICAL_SECTION in your Get function if you make sure that your program is playing by the rules: as many threads can have read-only access to the list as long as none of them does an insertion or deletion. This usually involves some other synchronization mechanisms, although at a higher level than on the linked list itself, which presumably will yield better performance.

If you cannot guarantee this behavior in your program, another possibility is to protect access by means of a read/write lock. Such a lock allows multiple threads to enter for read access, except if some thread has reclaimed write access. A web search gives the following article[^] by Ivan Krivyakov on implementing read/write locks in Windows.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Thread Safe Linked List Pin
Laing,James14-Sep-04 10:42
Laing,James14-Sep-04 10:42 
GeneralRe: Thread Safe Linked List Pin
Joaquín M López Muñoz14-Sep-04 10:59
Joaquín M López Muñoz14-Sep-04 10:59 
GeneralRe: Thread Safe Linked List Pin
Laing,James14-Sep-04 11:18
Laing,James14-Sep-04 11:18 
GeneralRe: Thread Safe Linked List Pin
Joaquín M López Muñoz14-Sep-04 11:30
Joaquín M López Muñoz14-Sep-04 11:30 
GeneralRe: Thread Safe Linked List Pin
Laing,James14-Sep-04 11:56
Laing,James14-Sep-04 11:56 
GeneralI almost understand, a little more advicie please. Pin
mcgahanfl14-Sep-04 2:47
mcgahanfl14-Sep-04 2:47 
GeneralRe: I almost understand, a little more advicie please. Pin
Hardy_Smith14-Sep-04 4:52
Hardy_Smith14-Sep-04 4:52 
GeneralRe: I almost understand, a little more advicie please. Pin
Emilio Garavaglia14-Sep-04 4:55
Emilio Garavaglia14-Sep-04 4:55 
GeneralRe: I almost understand, a little more advicie please. Pin
mcgahanfl14-Sep-04 6:13
mcgahanfl14-Sep-04 6:13 
GeneralViews in full-screen Pin
Jens Christiansen14-Sep-04 2:35
Jens Christiansen14-Sep-04 2:35 
GeneralActiveX problem Pin
archetype14-Sep-04 1:35
archetype14-Sep-04 1:35 
Generalcharts Pin
dana_krycek14-Sep-04 1:34
dana_krycek14-Sep-04 1:34 
GeneralAdding events to a std C++ class Pin
Alistair Lacy14-Sep-04 1:28
Alistair Lacy14-Sep-04 1:28 
GeneralRe: Adding events to a std C++ class Pin
Emilio Garavaglia14-Sep-04 2:55
Emilio Garavaglia14-Sep-04 2:55 
GeneralRe: Adding events to a std C++ class Pin
Alistair Lacy15-Sep-04 3:43
Alistair Lacy15-Sep-04 3:43 
GeneralAccessing any process's memory Pin
Member 136563313-Sep-04 23:26
Member 136563313-Sep-04 23:26 
GeneralRe: Accessing any process's memory Pin
Arsalan Malik13-Sep-04 23:40
Arsalan Malik13-Sep-04 23:40 

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.