Are CObList and CPtrList protected against concurrent access by
multiple threads? I presume the answer is "no". If one thread is in the
process of changing the list, e.g., Add Head, RemoveTail, etc., and
some other thread barges in to review the list, there is a potential
for the latter thread to sustain a memory violation, correct? A mutex
must be created for all threads to use when accessing the object,
correct? 2 2948
Frank Natoli wrote: Are CObList and CPtrList protected against concurrent access by multiple threads? I presume the answer is "no". If one thread is in the process of changing the list, e.g., Add Head, RemoveTail, etc., and some other thread barges in to review the list, there is a potential for the latter thread to sustain a memory violation, correct? A mutex must be created for all threads to use when accessing the object, correct?
CObList and CPtrList are not standard C++, and standard C++ doesn't
have built-in threading support (though it's a good possibility in
C++09). Hence, you should ask your question in a newsgroup related to
your platform (which, BTW, you didn't even mention, which means we
would have to speculate on who the vendor of such creatures is before
we could even attempt to give an accurate answer). See this FAQ for
what is on-topic here and for some suggestions of where you can post
your question: http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Cheers! --M
"Frank Natoli" <Fr**********@Earthlink.net> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com... Are CObList and CPtrList protected against concurrent access by multiple threads? I presume the answer is "no". If one thread is in the process of changing the list, e.g., Add Head, RemoveTail, etc., and some other thread barges in to review the list, there is a potential for the latter thread to sustain a memory violation, correct? A mutex must be created for all threads to use when accessing the object, correct?
None of 'CObList', 'CPtrList', 'concurrent access', 'threads', or
'mutex' are defined by the standard C++ language, so there's no
answer in the context of this newsgroup. Try a group where those
things are topical. A guess: 'CObList' and CPtrList' look to me
like Microsoft's MFC types. If so, an MFC group is where to ask.
(You can find a list of Microsoft-specific newsgroups at www.msdn.microsoft.com
Purpose of comp.lang.c++: http://www.slack.net/~shiva/welcome.txt
-Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Russ |
last post by:
Hello. I have a very large business application written all in VC++
and MFC. Now I want to interface some of it to the web. I have
VS.NET2003 and have been studing walkthroughs and documentation...
|
by: Ben Taylor |
last post by:
I've asked about includes before in this group in order to
stop files being #included either twice or not at all, and
somebody said to use extern keyword for global variables
that need to be used...
|
by: Gordon |
last post by:
Hello there.
I am attempting to move some working code to VC++ .Net2003.
The problem I have is with a structure (base class CObList)
that I use for a simple linked. It will not even compile
in...
|
by: Leith Bade |
last post by:
I have been trying to use the new Visual C++ Toolkit 2003 with the VC6 IDE
I set up the executable, inlcude, and library directories to point to the new compilers
I had to fix a few errors in the...
|
by: Lauro |
last post by:
I'm starting whit C++, so I don't andestand too much about .
I would like to know how can I inherit a generic class fron
CObjet class, all the time I try I recibe a message telling that
CObjet...
|
by: Greg Horwood |
last post by:
Dear All,
I need to create a dynamic array (linked list) of a data structure. In the
old days I would have used a C++ list class, or an MFC COblist class, and
used it to manage the structure...
|
by: deneb.dizajn |
last post by:
I'm writing this sorting just to understand how exactly works methods
in CObList. Iteration works fine, but it won't change pointers.
CObList myList;
CPerson* first, second;
POSITION next,...
|
by: bajajv |
last post by:
Hi,
What is the difference between CObList and CList? If we use a CList as - CList<CObject*, CObject*>, isnt it similar to CObList?
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |