Sys64738 Sys64738

Niner since 2007


  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 3 of n

    Thanks, we can now clearly read the code.


    I would have used simple C++ overload... but the template metaprogramming technique presented by STL is very cool!

    May some other lesson be dedicated to the template metaprogramming subject?



  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 3 of n

    Interesting video as well.


    +1 on the request of posting code.


    And comparing the ref-counted deterministic resource management offered by shared_ptr vs. garbage-collector systems, are the performance of ref-counted systems better than those offered by GC?

    I found this article in which there is a detailed comparison of resource management techniques, and in the "Performance" paragraph it seems to show that a tracing GC can offer better performance than a ref-counted system:


    Resource management


    And, as a side question: does it exist a tracing garbage collector for C++? The language is so powerful that I think it could be possible to write one. So people could still enjoy the advantages of C++ (e.g. portability on different platforms, not requiring download and installation of .NET framework, not wasting time for just-in-time compilation of code, etc.) and don't pay too much attention to memory allocation, cleanup, cycles, etc.


    Thanks, and looking forward for the next STL video.


  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 2 of n

    STL: Thanks for your excellent *practical* explanation of computational complexity!

    I read several more mathematical-oriented explanations, but they were too abstract and more "smoky", more vague; instead yours is very clear and effective.


    About performance, I'm looking forward to the interview with Bruce Dawson (BTW: I agree the performance of IE8 is not very good - I do hope that his contributions will make a difference in IE9).


    Speaking of performance, I used to think that when you really want the top performance, you should abandon STL and use a more C-like programming style. For example, there was an interesting series of blog posts about a Chinese/English Dictionary reader:


    Chinese/English Dictionary reader


    The original native C++ version used C++ standard library, and was slower than the original managed C# version.

    After some optimizations, the C++ version became faster than the managed C# version, but:


    [...] Of course he used available lower level libraries to do this, but that's still a lot of work.  Can you call what's left an STL program?  I don't think so [...]


    So, is it correct that when top performance is required (e.g. in a tight loop executed lots of times or in some other critical portion of code) we should abandon STL and use lower level C-like programming styles? Or is it possible to still use STL successfully in these scenarios?

    In Microsoft you guys write software used by millions of people worldwide: do you use STL in performance critical parts of your software?




  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 2 of n

    Is boost::thread a valid free alternative?


  • Introduction to Project Hilo

    It would be interesting to compare this native C++ app with a similar app written in C# using WPF, doing a fair comparison of some parameters, like start-up time, general responsiveness of the user interface, etc.


  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 1 of n



    And, if possible, please prepare a part 3 on C++ exceptions, exception-safety, etc.


    Thanks much!


  • BTC: David Heckerman - Biology, Machines, Medicine and Physics

    This is fascinating! Excellent.



  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 1 of n

    Excellent answer.



  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 1 of n

    Another question: if my understanding is correct, you said that STL can smartly use memcpy/memmove to quickly copy raw POD data, and instead it uses proper copy constructor for non-PODs. My question is: how can you (the implementer of STL) discriminate between POD and non-POD data? In other words, how can you ask a C++ class: "Are you a POD or are you a non-POD?" (such that you then could use memcpy/memmove optimization for PODs).




  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 1 of n

    Great video, STL!


    As a suggestion, I'd like a lesson (or a part of it...) on implementing custom allocators.

    In particular, it would be very interesting if you could show how to implement a ".NET-like" allocator which consists in preallocating a big chunk of memory and then just increase a pointer when a (small) amount is requested (so: allocating memory == pointer increase, very fast - and cleanup of the whole preallocated block is done at the end of the processing, kind of a very primitive "garbage collector").


    Moreover, kind of OT... but I'd appreciate if you could spend some minutes sharing with us some insights on when to use exceptions vs. normal error codes in C++ code. Do you use exceptions only for exceptionally bad error conditions? Should exceptions be used instead of error codes in modern C++?


    Thanks much for your time and knowledge sharing skills! Smiley



  • Larry Osterman: Happy Birthday Channel 9!

    I would love to watch an interview with Larry speaking about some software engineering issues and sharing his monumental experience with us in native coding.
    For example, listening to him explaining us why they don't use C++ exceptions, or some discussions about subtle bugs he had to solve, etc.

    And, of course: Happy Birthday Channel 9! Smiley

  • Intelligent Light: ​Computation​al Fluid Dynamics and High Performance Computing

    This interview is very interesting!!
    Great job Charles!

    I was curious about the rendering technology: do they use OpenGL for their scientific rendering like the velocity fields etc.?


View All