顯示具有 performance 標籤的文章。 顯示所有文章
顯示具有 performance 標籤的文章。 顯示所有文章

2014年2月24日 星期一

An implementation of queue with socket in linux.

I have found an efficient-enough way for exchanging data between threads, and unsurprisingly the concept of `Queue' is a rough answer. To be more precise, there are more than data storage to be considered:

2013年12月28日 星期六

Implementations of singleton in C.

Singleton is usually an important and necessary pattern, no matter in any programming languages, for developing flows. The point which is cared here, is if the property could be assured consisted, could be checked by compiler.

2013年12月10日 星期二

Another private problem in C.

Rather than the private property in the C structures, the optional-private property(or usually be called as namespace) is more interesting and suffering. The situation might be, there is a big system, which contains several subsystems, each has its own interfaces to be accessed by the other subsystems, or the application if it is a library. Beside the interface, there are also some implement helper functions which are expected to be called only within the subsystem, such as callback functions, helper functions, reused code fragments... etc. As a simple example, say we have a subsystem handles socket stuff:

2013年6月2日 星期日

A further look at the gcc __sync_bool_compare_and_swap.

Continuing the looks-pretty-good gcc atomic CAS functions, the point would be how to move these great results in application and make the pretty testing result helps. For the purpose to understand clearly its behavior, some more tests have been done.


2013年5月22日 星期三

A rough survey on gcc builtin atomic operations.

When my colleague suggested me the gcc __sync_* functions, not much interest to me for which was treated as a low-level lock rather than a lock-free pattern. But it does surprise me after some survey.