::News.Latest

Site Update

Recently we updated our site’s framework to use WordPress. This should allow easier content management, as well as several new features. Article comments are now enabled, as well as in-site search and new member registration.
Hope you enjoy the changes,
CodeMaestro team

| No comments
::Reviews.Latest

Shared Memory In Linux

Linux, like most POSIX / System V compatible operating systems prefer processes over threads, as a matter of fact, a POSIX thread is nothing but a process with a layer of abstraction.

Posted by Ami Chayun | | [2] comments

Optimizing Singletons With Double Checks

Writing a thread safe singleton has its difficulties. One of them is making sure that the dynamic creation of the inner singleton object is thread safe, while locking as few mutexes as possible.

Posted by Ofer Kapota | | One comment

Magical Square Root Implementation In Quake III

Any 3D engine draws it’s power and speed from the mathematical models and implementations within, and trust John Carmack of ID software for using really good hacks. As it turns out, a very interesting hack is used in Quake III to calculate an inverse square root.

Posted by Tomer Margolin | | [22] comments

Fast Atomic Counters With the x86 LOCK Prefix

Atomic counters are the foundation of any thread safe reference counter. They are also common in daily use for thread counting and many other uses. Regularly, implementing thread safe atomic counters can be done in several ways, but always with a performance cost. In this review we will examine a method to implement a reference counter with a single assembly instruction.

Posted by Ami Chayun | | No comments

Controlling the Packing Alignment to Minimize Memory Consumption in C/C++

Do you know how much memory your structs and classes require? Unless you plan carefully, structs and classes may require as much as twice memory than actually needed, due to the compiler’s default packing alignment. The pack directive can be used in order to define the best packing alignment for your code.

Posted by Tomer Margolin | | No comments

Loop Unrolling with Duff’s Device

Loop unrolling, or unwinding, is simply reducing the number of overhead instructions that the CPU has to execute in a loop, thus improving the cache hit rate and the loop’s run time.

Posted by Tomer Margolin | | No comments

Journey into CPUID

Some programs rely on specific CPU instructions, with features like MMX, 3DNow!, Hyper Threading, etc. Some of them even rely on the specific CPU version. How would they know for sure that the CPU has what it takes to operate?

Posted by Tomer Margolin | | No comments

::Atricles.Latest

Easy DWORD-Alignment of Binary Structures

Information stored in binary data structures is an area so fundamental that there is hardly any field in the industry that doesn’t relate to the parsing or extracting of binary memory sources. However, my intention in this article are so small and specific, that I really want to believe there’s someone else out there […]

Posted by Eyal Itskovits | | No comments

Implementing a Message Dispatcher in Multi-Core Environments

Multi core programming presents different challenges than traditional parallel computing. In this article we will explore a programming paradigm called ‘the dispatcher’ and its implementation in multi-core environment.

Posted by Ami Chayun | | No comments

Implementing Callback Functions Using Delegates in C++

Nice C++ object oriented code basically means writing everything in objects/classes. However, not everything we need in programming is classes. This article concentrates on callback functions, and presents a C++ implementation of delegates which doesn’t use pointers to functions.

Posted by Slavik Birger | | No comments

Operator new Surprises in VC6

This item is a must for every Visual C++ 6.0 programmer which uses operator new. The default behavior of operator new in Microsoft Visual C++ 6.0 in case of an error is to return NULL, in total contrast to the standard which explicitly states that new raises a bad_alloc exception upon failure. This behavior can lead to many unpleasant surprises, especially when trying to write portable code.

Posted by Tomer Margolin | | No comments

Asynchronous Message Handling in MFC

This article presents a possible solution to an inherited problem in the MFC programming environment. According to the MFC architecture, all messages are handled synchronously. Of course, this issue makes no difference in the case that for every single message you want to process, the processing will take you only a short time.

Posted by Slavik Birger | | No comments

Delay Load Dlls Error Recovery - Putting the ‘D’ back in the Dll

This article suggests that dynamic loading errors can be solved quite easily by using the delay load Dlls mechanism wisely, and demonstrates a way to transform any code that uses Dll’s to be error free using the delay load mechanism, while keeping it’s elegance.

Posted by Tomer Margolin | | No comments

::Sidebar
::Links
  • xkcd
  •  

    Powered by WordPress