home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,890 of 33,346   
   Thomas Richter to All   
   Re: C++11 multithreading support obsolet   
   02 Mar 13 04:26:20   
   
   From: thor@math.tu-berlin.de   
      
   Am 02.03.2013 07:18, schrieb Ian Collins:   
      
   > I can understand why you can't use dynamic allocation, exceptions or   
   > threads, but why can't you use RAII?   
      
   Well, of course I can use RAII, just that the major advantage of RAII   
   goes away, namely proper resource management in the presence of   
   exceptions. As there are not the latter, there is no need for the   
   former. If you simulate exceptions with a setjmp logic, the stack is   
   not unrolled - only jumped over - and thus destructors are not   
   called. RAII is unfortunately of limited use in such a limited   
   environment. It requires a very different programming style.   
      
   > I use C++ for kernel modules which suffer similar constraints and   
   > RAII is one of the main reasons I prefer C++ over C in that domain.   
      
   If you don't have exceptions, and *no* exception simulation but handle   
   everything by return codes, then that is also an option, yes.   
      
   Greetings,   
   	Thomas   
      
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca