Overview
Features
Download
Documentation
Community
Add-Ons & Services

Some questions

A general discussion forum.

Some questions

Postby closetgeek » 09 Dec 2012, 21:04

Hi, I'm not knew to C++ or C, however I have very little realworld experience with them. My background mainly includes Java, PHP, and Actionscript.

My questions regarding this library is whether it provides a framework for garbage collections, such as when you use its auto pointers. I understand that I would be on my own if I created a pointer and other vars manually using C, but does this framework provide much useful help in managing such things?

Another thing is how well does the thread library work? Does it create much overhead outside of the normal cost of creating threads and basic thread management?

Thanks
closetgeek
 
Posts: 4
Joined: 09 Dec 2012, 20:55

Re: Some questions

Postby alex » 09 Dec 2012, 22:07

closetgeek wrote:My questions regarding this library is whether it provides a framework for garbage collections, such as when you use its auto pointers. I understand that I would be on my own if I created a pointer and other vars manually using C, but does this framework provide much useful help in managing such things?

See AutoPtr and SharedPtr. But those (and more) are coming with C++11 anyway. Plus, dont think what you lose but what you gain, namely RAII which provides better garbage collection for higher-level garbage (handles, sockets, locks etc) than Java or C #.
closetgeek wrote:Another thing is how well does the thread library work? Does it create much overhead outside of the normal cost of creating threads and basic thread management?

It is designed and works well; no unnecessary overhead
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Some questions

Postby closetgeek » 09 Dec 2012, 22:28

Are you saying that RAII is a standard in POCO libraries or just that it will be available in C++11?
Thanks you for your reply.
closetgeek
 
Posts: 4
Joined: 09 Dec 2012, 20:55

Re: Some questions

Postby rakesh » 10 Dec 2012, 01:35

RAII is more of a design pattern and does not depend upon C++11. In a nutshell it is about acquiring a resource (socket, connection, file handle, mutex, ...) in the constructor on a class and "close" it in the destructor for the class. The beauty of closing in the destructor is that the closing logic will execute even in case of an exception (Java gives you this feature through the finally code block), but with RAII, you do not need to do that manually every time you use your resource (kind of what Spring etc. try to give you).
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest