Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCRecordset::Update()? Pin
26-Apr-02 22:17
suss26-Apr-02 22:17 
AnswerRe: CRecordset::Update()? Pin
Tim Deveaux27-Apr-02 4:40
Tim Deveaux27-Apr-02 4:40 
GeneralScanner ActiveX !!! Pin
Hadi Rezaee26-Apr-02 21:55
Hadi Rezaee26-Apr-02 21:55 
GeneralRead-Write locks... Pin
Matt Gullett26-Apr-02 16:04
Matt Gullett26-Apr-02 16:04 
GeneralRe: Read-Write locks... Pin
Michael Dunn26-Apr-02 16:51
sitebuilderMichael Dunn26-Apr-02 16:51 
GeneralRe: Read-Write locks... Pin
Matt Gullett26-Apr-02 17:08
Matt Gullett26-Apr-02 17:08 
GeneralRe: Read-Write locks... Pin
Nemanja Trifunovic26-Apr-02 17:35
Nemanja Trifunovic26-Apr-02 17:35 
GeneralRe: Read-Write locks... Pin
Chris Hafey26-Apr-02 18:57
Chris Hafey26-Apr-02 18:57 
We use the very cool open source library ACE (see http://deuce.doc.wustl.edu/) for this kind of thing. If all you need is a read/write lock, it is overkill, but you might get some ideas from the source. I am sure that you can find one on the net somewhere, take a look at the links section on the C/C++ users journal web site (www.cuj.com) or cetus-links (http://www.cetus-links.com/).

Since you have such a large percentage of writers, a better approach would be to use multiple maps and distribute the data evenly across the maps. For example, if your key is a string you can hash it and mod by the number of maps to figure out which one the data belongs to. Each map would have its own critical section structure which you would lock before you read or write to that map.

If your data set is predictable, you can build a function that results in even distribution of the data across the maps. If your data set is not predictable, use a large number of maps and a good hash function to minimize contention.

Chris Hafey
GeneralRe: Read-Write locks... Pin
JT Anderson29-Apr-02 13:54
JT Anderson29-Apr-02 13:54 
GeneralBooks :) Pin
SilverShalkin26-Apr-02 15:44
SilverShalkin26-Apr-02 15:44 
GeneralRe: Books :) Pin
Shog926-Apr-02 17:44
sitebuilderShog926-Apr-02 17:44 
GeneralRe: Books :) Pin
Christian Graus26-Apr-02 17:59
protectorChristian Graus26-Apr-02 17:59 
GeneralRe: Books :) Pin
l a u r e n26-Apr-02 22:49
l a u r e n26-Apr-02 22:49 
GeneralRe: Books :) Pin
SilverShalkin27-Apr-02 6:06
SilverShalkin27-Apr-02 6:06 
GeneralRe: Books :) Pin
Brian Delahunty27-Apr-02 6:55
Brian Delahunty27-Apr-02 6:55 
GeneralRe: Books :) Pin
Michael P Butler27-Apr-02 10:33
Michael P Butler27-Apr-02 10:33 
QuestionManaged C++ Web Service... is trying to download?? Pin
Adam Clauss26-Apr-02 15:16
Adam Clauss26-Apr-02 15:16 
GeneralmciSendString - AVI file with strange colours Pin
26-Apr-02 13:35
suss26-Apr-02 13:35 
GeneralRe: mciSendString - AVI file with strange colours Pin
Tom Archer26-Apr-02 14:34
Tom Archer26-Apr-02 14:34 
GeneralRe: mciSendString - AVI file with strange colours Pin
26-Apr-02 15:47
suss26-Apr-02 15:47 
GeneralRe: mciSendString - AVI file with strange colours Pin
Tom Archer26-Apr-02 15:51
Tom Archer26-Apr-02 15:51 
GeneralDebug Output Window Pin
RaviJoshi26-Apr-02 12:51
RaviJoshi26-Apr-02 12:51 
GeneralRe: Debug Output Window Pin
Michael P Butler27-Apr-02 10:46
Michael P Butler27-Apr-02 10:46 
QuestionDisplay a graph / Extend CListView? Pin
26-Apr-02 12:21
suss26-Apr-02 12:21 
QuestionHow to place and drive activex controls in CView Pin
HallerbachJ26-Apr-02 10:33
HallerbachJ26-Apr-02 10:33 

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.