Click here to Skip to main content
16,004,406 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionLocking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6426-Dec-23 8:02
professionalRichard Andrew x6426-Dec-23 8:02 
AnswerRe: Locking pattern to protect a critical List<> with many worker threads Pin
Mircea Neacsu26-Dec-23 8:17
Mircea Neacsu26-Dec-23 8:17 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6426-Dec-23 8:39
professionalRichard Andrew x6426-Dec-23 8:39 
AnswerRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell27-Dec-23 5:27
jschell27-Dec-23 5:27 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6427-Dec-23 5:32
professionalRichard Andrew x6427-Dec-23 5:32 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
harold aptroot27-Dec-23 8:01
harold aptroot27-Dec-23 8:01 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6427-Dec-23 8:32
professionalRichard Andrew x6427-Dec-23 8:32 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads [edited] Pin
harold aptroot27-Dec-23 9:23
harold aptroot27-Dec-23 9:23 
A shallow copy does the trick. jschell doesn't want to call this a shallow copy, whatever. What I meant, and what the whole thread has always been about, is assigning the list to a local variable, and never editing its contents, only replacing the whole thing. The list which a reader is iterating over does not change since it has an .. even shallower f***ing copy, whatever the f*** you want to call it. Copy of the pointer. They can update that when they're ready for it to change.

The list is never modified anyway, only replaced. At least that was the premise of this sub-thread stared by jschell

modified 29-Dec-23 11:32am.

GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell28-Dec-23 5:55
jschell28-Dec-23 5:55 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
harold aptroot28-Dec-23 6:19
harold aptroot28-Dec-23 6:19 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell29-Dec-23 4:46
jschell29-Dec-23 4:46 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
harold aptroot29-Dec-23 5:19
harold aptroot29-Dec-23 5:19 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell1-Jan-24 1:59
jschell1-Jan-24 1:59 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell28-Dec-23 5:54
jschell28-Dec-23 5:54 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6428-Dec-23 7:39
professionalRichard Andrew x6428-Dec-23 7:39 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell29-Dec-23 4:49
jschell29-Dec-23 4:49 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6429-Dec-23 13:25
professionalRichard Andrew x6429-Dec-23 13:25 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
jschell1-Jan-24 1:57
jschell1-Jan-24 1:57 
AnswerRe: Locking pattern to protect a critical List<> with many worker threads Pin
Gerry Schmitz27-Dec-23 8:23
mveGerry Schmitz27-Dec-23 8:23 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Richard Andrew x6427-Dec-23 8:29
professionalRichard Andrew x6427-Dec-23 8:29 
GeneralRe: Locking pattern to protect a critical List<> with many worker threads Pin
Gerry Schmitz28-Dec-23 6:37
mveGerry Schmitz28-Dec-23 6:37 
QuestionGuides on solving this recurrence relation equation? Pin
oslon1-Dec-23 21:54
oslon1-Dec-23 21:54 
AnswerRe: Guides on solving this recurrence relation equation? Pin
Andre Oosthuizen1-Dec-23 22:12
mveAndre Oosthuizen1-Dec-23 22:12 
AnswerRe: Guides on solving this recurrence relation equation? Pin
jeron12-Dec-23 7:13
jeron12-Dec-23 7:13 
AnswerRe: Guides on solving this recurrence relation equation? Pin
jschell4-Dec-23 3:25
jschell4-Dec-23 3:25 

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.