This is a discussion on Smart pointer solution to this problem? within the Software Patterns forums, part of the Testing category; Hello, I have a C++ application where I create a message object and pass it along to different threads for ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Smart pointer solution to this problem?
Hello,
I have a C++ application where I create a message object and pass it along to different threads for processing. How can I manage the destruction of this message so that it is automatically deleted when the last thread or process is done with it? I suppose the simplest approach might be to clone the object before passing it along, and make each object that receives this object responsible for its destruction. I think a smart pointer might solve this problem, can someone recommend an implementation? As you've probably already figured out, I don't know much about smart pointers ... -Randy |
|
|||
|
Re: Smart pointer solution to this problem?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 In article <8fednY9OrYpqnlyiU-KYjQ@giganews.com>, on Sun, 23 Nov 2003 11:01:09 -0800, "RJGraham" <spamcop_764376_@surfbytes_123_._5637.com_4785> wrote: <snip /> | I think a smart pointer might solve this problem, can someone recommend an | implementation? <sigh> When are people going to learn how to use google? </sigh> <http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=c%2B%2B+%2B%22smart+pointer%22> <davidp /> - -- David Postill -----BEGIN PGP SIGNATURE----- Version: PGP 8.0.3 - not licensed for commercial use: www.pgp.com Comment: Get key from pgpkeys.mit.edu:11370 iQA/AwUBP8EeKXxp7q1nhFwUEQK8+ACg6vqnkUELeAJ1lLE7CdRYV/ZNg+4AmwXN QjUJfmpVMytg5h3ZOPOBkat6 =BYlB -----END PGP SIGNATURE----- |
|
|||
|
Re: Smart pointer solution to this problem?
Thanks, but I've already done a Google search.
I was hoping someone could recommened a specific smart pointer implementation that would help solve my specific problem. -Randy "David Postill" <david@postill.org.uk> wrote in message news:ke72svcv2kcuafic35bsi3bnac40aai4vb@4ax.com... > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > In article <8fednY9OrYpqnlyiU-KYjQ@giganews.com>, on Sun, 23 Nov 2003 11:01:09 -0800, "RJGraham" > <spamcop_764376_@surfbytes_123_._5637.com_4785> wrote: > > <snip /> > > | I think a smart pointer might solve this problem, can someone recommend an > | implementation? > > <sigh> > When are people going to learn how to use google? > </sigh> > > <http://www.google.com/search?sourcei...tf-8&q=c%2B%2B +%2B%22smart+pointer%22> > > <davidp /> > > - -- > David Postill > > -----BEGIN PGP SIGNATURE----- > Version: PGP 8.0.3 - not licensed for commercial use: www.pgp.com > Comment: Get key from pgpkeys.mit.edu:11370 > > iQA/AwUBP8EeKXxp7q1nhFwUEQK8+ACg6vqnkUELeAJ1lLE7CdRYV/ZNg+4AmwXN > QjUJfmpVMytg5h3ZOPOBkat6 > =BYlB > -----END PGP SIGNATURE----- > |