Exforsys

Online Training

Smart pointer solution to this problem?

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


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-23-2003, 03:01 PM
RJGraham
Guest
 
Posts: n/a
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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-23-2003, 04:53 PM
David Postill
Guest
 
Posts: n/a
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-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-23-2003, 07:05 PM
RJGraham
Guest
 
Posts: n/a
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-----
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.