SharedPtr reference count

General discussion regarding the development of POCO for contributors.
chrisjones
Posts: 35
Joined: 28 Jan 2008, 22:01
Location: United_Kingdom

SharedPtr reference count

Postby chrisjones » 03 May 2008, 01:17

I started to make my own SharedPtr class for OGE, as i want to use TBBs spin_mutex for the reference counting instead of a full mutex as we need it to run as fast as possible. i realised that the only thing that needs to change is the reference counter class.

Would it be possible/allowed to add a template paramater to the Poco::SharedPtr class that you can specify the class to use as the reference counter? it can be defaulted to use the ReferenceCounter class you already have so i don't think it would involve any changes for anyone using it, but it would be possible to specify my own ReferenceCounter class that uses a different type of mutex. Also if an application was guarateed to be single threaded a reference counter with no mutex/lock could be used.

what do you think? should i do this?

Chris

chrisjones
Posts: 35
Joined: 28 Jan 2008, 22:01
Location: United_Kingdom

Re: SharedPtr reference count

Postby chrisjones » 03 May 2008, 01:54

Sorry for double posting, but i made the changes. the test unit for SharedPtr works without errors and i havent had to make any changes to that code.

so now its template class SharedPtr ...
if you accept it of course you can change the name RC, i didnt know what to use

ill try to work out how to submit it

alex
Posts: 1294
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: SharedPtr reference count

Postby alex » 03 May 2008, 10:30

> what do you think? should i do this?

I don't see a problem doing it.

Alex

chrisjones
Posts: 35
Joined: 28 Jan 2008, 22:01
Location: United_Kingdom

Re: SharedPtr reference count

Postby chrisjones » 07 May 2008, 18:23

I've emailed the changes to the email address given on the poco contribute page.

Chris

guenter
Posts: 1194
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Re: SharedPtr reference count

Postby guenter » 07 May 2008, 18:36

The changes are in the SVN trunk (rev. 531)


Return to “Contributors”

Who is online

Users browsing this forum: No registered users and 1 guest

cron