Re: Denial of denial of service

[prev] [thread] [next] [lurker] [Date index for 2007/01/31]

From: Yossi Kreinin
Subject: Re: Denial of denial of service
Date: 08:04 on 31 Jan 2007
Peter da Silva wrote:
>>On Mon, 29 Jan 2007, Peter da Silva wrote:
> 
> 
> So you create objects representing external resources like files,
> database tables, locks, and never expose an uncommitted transaction in
> any other way?
> 
> 

Of course! Theoretically. In practice there is no automatic way to make sure 
"uncommitted transactions" weren't exposed in other ways; in fact there is no 
automatic way to make sure plain old memory wasn't acquired in other ways (like 
calling malloc or new and assigning the result to a bare pointer). So most code 
is not really exception safe, but it could be written to be. Theoretically.

There's a plethora of smart-ass pointers, ranging from std::auto_ptr to 
boost::shared_ptr, and a variety of home-made ones; these are supposed to 
provide exception safety, among other things, by making sure resources are 
released in destructors. Converting between all these pointers, one smarter than 
the other, and figuring out what the hell does the program mean with all this 
intertwingled smart pointing, is one of the reasons C++ programming is the fun 
it is. It's almost as much fun as converting char*, wchar*, std::string, 
std::wstring, MFC CString, 
MyOwnStringClassIWroteBeforeSTLAndNowItsAllOverThePlaceDamnIt, and other string 
types to each other.
There's stuff above here

Generated at 23:01 on 06 Feb 2007 by mariachi 0.52