Overview
Features
Download
Documentation
Community
Add-Ons & Services

A few additions

Discussion of ideas for features and new projects based on POCO.

A few additions

Postby chrisjones » 14 Feb 2008, 11:51

hi, ive started using poco with OGE now as i am gradually refactoring it.

Theres just a few things ive noticed/thought of that i thought i'd mention, some of which i might be able to contribute im not sure.

- Retrieve the reference count from a SharedPtr. I looked at the code, i dont think you can currently do this, correct me if im wrong. I think this will be needed a few times, such as when unloading a plugin, checking that theres no SharedPtrs that are using it, for example, i have a virtual file system which will allow plugins of new types (compress archives, remote files etc).
I think this will be easy to add, i could do it, is this a change that you will allow? How do i go about submitting my changes?

- WeakPtr. ive seen another post here requesting them. i might have a go at implementing them if you arent planning to add them? Any advise on implementing them?

- Lock/wait-free classes. Instead of using FastMutex, code that accesses small amounts of data very quickly would benefit from not using heavy system calls. Code like updating the reference count on a SharedPtr for example has alot of overhead for updating the count. Ive tried researching this, but i find very limited information on the net. Does anyone have any information or links about this? could this be implemented for poco? The main difficulty ive found is knowing if something will work on multiprocessor computers, such as various x86 instructions etc

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

Re: A few additions

Postby alex » 14 Feb 2008, 16:17

> - Retrieve the reference count from a ))SharedPtr((. I looked at the code, i dont think you can currently do this, correct me if im wrong. I think this will be needed a few times, such as when unloading a plugin, checking that theres no ))SharedPtrs(( that are using it, for example, i have a virtual file system which will allow plugins of new types (compress archives, remote files etc).

> I think this will be easy to add, i could do it, is this a change that you will allow?

It should not be a big deal. I do wonder, though, whether it will give you what you want. Namely, if your object pointer is wrapped in ))SharedPtr((, the object itself knows nothing of it. This is unlike ))AutoPtr((, where the wrapped pointed to object must have duplicate()/release() functions implemented, so you know inside the object how many references to it exist at any given time.

>How do i go about submitting my changes?

Read How to contribute and act accordingly.

> - ))WeakPtr((. ive seen another post here requesting them. i might have a go at implementing them if you arent planning to add them? Any advise on implementing them?

Sure. Take the Boost implementation and POCO-ify it. If there's any room for improvement or need for modification as we see fit, we can do that.

> - Lock/wait-free classes. Instead of using ))FastMutex((, code that accesses small amounts of data very quickly would benefit from not using heavy system calls. Code like updating the reference count on a SharedPtr for example has alot of overhead for updating the count. Ive tried researching this, but i find very limited information on the net. Does anyone have any information or links about this? could this be implemented for poco? The main difficulty ive found is knowing if something will work on multiprocessor computers, such as various x86 instructions etc

Alexandrescu and Stroustrup have published CAS-related papers. Check their work., I'm not sure whether it is a production ready paradigm yet.

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

Re: A few additions

Postby lazalong » 16 Feb 2008, 01:46

> - Lock/wait-free classes. Instead of using FastMutex, code that accesses small amounts of data very quickly would benefit from not using heavy system calls.

For those interested in implementing those algorithms my I suggested to take a look at the article 1.1 "Lock-Free algorithms" of the book "Game Programming Gems 6". It also contains several references.

However it seems one of the problem of lock-free algorithms is that several patents exist that covers them. So it would be a valuable addition to POCO if you achieve implementing patent-free algorithms.
lazalong
 
Posts: 16
Joined: 15 Feb 2008, 08:36
Location: Australia


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest