Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. unmanaged resource

unmanaged resource

Scheduled Pinned Locked Moved C / C++ / MFC
questionperformancelearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    George_George
    wrote on last edited by
    #1

    Hello everyone, I think unmanaged resource means the resources (e.g. memory and file handler) which is used directly (new, FILE*) other than using a wrapper class (Resource Acquisition Is Initialization) or auto_ptr to wrap it. Is my understanding correct? Here is a sample about what is unmanaged resource. -------------------- http://www.gotw.ca/gotw/066.htm Moral #3: Always perform unmanaged resource acquisition in the constructor body, never in initializer lists. In other words, either use "resource acquisition is initialization" (thereby avoiding unmanaged resources entirely) or else perform the resource acquisition in the constructor body. -------------------- thanks in advance, George

    F L 2 Replies Last reply
    0
    • G George_George

      Hello everyone, I think unmanaged resource means the resources (e.g. memory and file handler) which is used directly (new, FILE*) other than using a wrapper class (Resource Acquisition Is Initialization) or auto_ptr to wrap it. Is my understanding correct? Here is a sample about what is unmanaged resource. -------------------- http://www.gotw.ca/gotw/066.htm Moral #3: Always perform unmanaged resource acquisition in the constructor body, never in initializer lists. In other words, either use "resource acquisition is initialization" (thereby avoiding unmanaged resources entirely) or else perform the resource acquisition in the constructor body. -------------------- thanks in advance, George

      F Offline
      F Offline
      Florin Crisan
      wrote on last edited by
      #2

      Yes, I think that's pretty much the idea. Basically, in this context, 'unmanaged' means anything that is not destroyed/deallocated/uninitialized automatically. In Microsoft parlançe, though, 'unmanaged' means native code, as opposed to native code. (At least that's how I understood it.)

      Florin Crisan

      1 Reply Last reply
      0
      • G George_George

        Hello everyone, I think unmanaged resource means the resources (e.g. memory and file handler) which is used directly (new, FILE*) other than using a wrapper class (Resource Acquisition Is Initialization) or auto_ptr to wrap it. Is my understanding correct? Here is a sample about what is unmanaged resource. -------------------- http://www.gotw.ca/gotw/066.htm Moral #3: Always perform unmanaged resource acquisition in the constructor body, never in initializer lists. In other words, either use "resource acquisition is initialization" (thereby avoiding unmanaged resources entirely) or else perform the resource acquisition in the constructor body. -------------------- thanks in advance, George

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        George_George wrote:

        (thereby avoiding unmanaged resources entirely)

        That is an unfortunate use of the word "unmanaged". RAII is about managing resources. This is the first person I have ever seen use the word "unmanaged" in reference to "managing resources". The author seems to be using "unmanaged" to reference code that does not implement RAII. It seems to me that the usage is incorrect because you are always managing a resource even if you do not use an RAII approach. IMHO the word has been used improperly. [Modification] Ummm ok. The author is Herb Sutter so I think he can say whatever he likes. "unmanaged" is fine by me. :-\

        modified on Wednesday, January 02, 2008 3:07:20 PM

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups