Memory Allocation in a Multi-Threaded Environment
- From: "Jeff" <someone@xxxxxxxxxxxxx>
- Date: Sun, 8 Jun 2008 12:23:22 +0100
Hi - not sure if this is the best forum for this question?
I'm using vc++ 2005 and I've just started playing around with
multithreading.
I quickly realised that multi-threading opens up a whole new slew of bugs
for the novice, but there is one area that is really confusing me.
I have a small class that uses an std::vector array. I create a new worker
process with afxbeginthread - this process will expand/contract the vector
(and do some other stuff) and then return. The problem is, I seem to get
heap corruption errors when I try to access the memory allocated in the
worker thread after that thread has finised. Is this to be expected or
should I be looking elswhere for the bug?
Any general comments on memory allocation in a multi-threaded environment?
Thanks
Jeff
.
- Follow-Ups:
- Possible source of memory corruption
- From: WhiteFang
- Re: Memory Allocation in a Multi-Threaded Environment
- From: David Lowndes
- Possible source of memory corruption
- Prev by Date: Resource-only DLLs
- Next by Date: Re: Memory Allocation in a Multi-Threaded Environment
- Previous by thread: Resource-only DLLs
- Next by thread: Re: Memory Allocation in a Multi-Threaded Environment
- Index(es):
Relevant Pages
|
Loading