Archive for April, 2008

How to solve weirdness of the high resolution counter

In a previous post, some issues on QueryPerformanceCounter() was discussed.
Fortunately I found a very good blog, Zooba’s Blog on problems using counters like rdtsc and QueryPerformanceCounter. Because there is additional processing time needed to get the CPU frequency that is used along with the result of rdtsc, or because just approximate frequency is used by [...]

Continue reading »

OBJC_API_VERSION and __OBJC2__

I would like to post an answer from the objc-language mailing list.
On Apr 25, 2008, at 2:06 PM, JongAm Park wrote:
With C++, there is a macro*__cplusplus*. Is there anything analogous for the Objective-C 2.0?
The Xcode 3.0 support converting to Obj-C 2.0 code from pre-2.0 code. However, there are people who still use Obj-C pre 2.0, [...]

Continue reading »

Difference in Concurrency Model in MacOS X and the Windows (3)

3. Event
Windows is made based-on event-driven model. Therefore, events play very important role on Windows environment, and are used very often whether a programmer make one or use ones provided by the OS. Let’s take a look at how events are used.
Windows는 event-driven 모델을 써서 만들어졌다. 그러므로 event는 상당히 중요한 역할을 하고, 많은 프로그램들이 OS가 [...]

Continue reading »

Difference in Concurrency Model in MacOS X and MS Windows (2)

This post is the 2nd part of the previous post a while ago. As I promised before, this series of post is written in English and Korean.
  OK. It is time to return back to this issue, “multi-threading design” on Windows and Mac. When I studied multi-threading and synchronization on Windows after [...]

Continue reading »

Impressive battery life of 2007 Nov. version of MacBook

Sometimes it is relaxing to go back to non-technical subject.
I have used the base model of MacBook for a few months. Usually I don’t believe manufacturer’s claim on battery life. If they say that it lasts for 4 hours, the new battery will last about 2 hour and 30 minutes usually, and more realistically 2 [...]

Continue reading »

QueryPerformanceCounter() equivalent on Mac OS X

Timer is quite an issue to some people who need to process image in realtime or who want to measure very fast code.
Because the QueryPerformanceCounter() and QueryPerformanceFrequency() are discussed in my previous post, one will raise a question, “Is there a similar function for the Mac OS X?”.
Yeah.. Actually, my blog stat showed that [...]

Continue reading »

Weirdness of the High Resolution Counter, i.e. QueryPerformanceCounter()

For the most of time, using clock() for measuring performance for a block can be enough.
However, there are some cases where you want to compare two logically identical but differently implemented blocks.
Let’s assume that you want to compare performance of intrinsic version of strcpy and your own implementation of strcpy block written in SIMD instructions.
In [...]

Continue reading »

GCC comes with Mac OS X 10.4.x and 10.5.x doesn’t support flexible array member

According to GCC manual, it supports flexible array member.

struct foo { int x; int y[]; };
struct bar { struct foo z; };

struct foo a = { 1, { 2, 3, 4 } }; // Valid.
struct bar [...]

Continue reading »