Click here to Skip to main content
15,887,485 members
Home / Discussions / Algorithms
   

Algorithms

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder28-Jul-09 2:32
cofounderChris Maunder28-Jul-09 2:32 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Mar-09 10:13
cofounderChris Maunder16-Mar-09 10:13 
Questionbfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
TalespinTales1-Jan-24 7:18
TalespinTales1-Jan-24 7:18 
AnswerRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
Dave Kreskowiak1-Jan-24 9:26
mveDave Kreskowiak1-Jan-24 9:26 
GeneralRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
TalespinTales1-Jan-24 9:31
TalespinTales1-Jan-24 9:31 
GeneralRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
Dave Kreskowiak1-Jan-24 10:46
mveDave Kreskowiak1-Jan-24 10:46 
GeneralRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
TalespinTales1-Jan-24 10:54
TalespinTales1-Jan-24 10:54 
GeneralRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
Dave Kreskowiak1-Jan-24 12:36
mveDave Kreskowiak1-Jan-24 12:36 
AnswerRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
Gerry Schmitz1-Jan-24 11:04
mveGerry Schmitz1-Jan-24 11:04 
AnswerRe: bfs, dfs, a* & dijkstra algorithms - find the shortest route Pin
jschell2-Jan-24 6:32
jschell2-Jan-24 6:32 
Question[SOLVED] Representing Metadata Pin
Richard Andrew x6429-Dec-23 13:52
professionalRichard Andrew x6429-Dec-23 13:52 
AnswerRe: [SOLVED] Representing Metadata Pin
Gerry Schmitz30-Dec-23 6:50
mveGerry Schmitz30-Dec-23 6:50 
GeneralRe: [SOLVED] Representing Metadata Pin
Richard Andrew x6430-Dec-23 12:52
professionalRichard Andrew x6430-Dec-23 12:52 
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 
My program contains a List<T> object that is extremely critical to the program's function.

In normal use, it will be accessed by many ( >10 ) worker threads.

I don't need to synchronize worker thread access, because the workers never write to the collection, it's read-only to the worker threads.

However, I want to be able to make changes to the list in a single, central class. And I'd like to be able to temporarily shut off worker-thread access to the list while changes are being made by a thread in the central class.

I'd like not to require the worker threads to acquire a mutex every time they need access due to performance reasons.

So, is there a pattern by which I can make access to the List<T> very fast for the worker threads, but still be able to shut off worker access while the list is being updated by the central class?



The difficult we do right away...
...the impossible takes slightly longer.

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 
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 

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.