суббота, 18 июня 2011 г.

http://pocoproject.org - похоже, всё-таки есть достойная библиотека для серверов на C++ /но там какие-то проблемы с epoll... duh!/

воскресенье, 10 апреля 2011 г.

gettimeofday() можно оптимизировать, отобразив страницу памяти с информацией о текущем времени в userspace. В Linux это уже реализовано для x86_64 (но не для i386).

Red Hat, gettimeofday, VDSO

четверг, 3 февраля 2011 г.

О зарезервированных символах в POSIX (конкретно - о суффиксе _t в typedef'ах).
Имена типов, оканчивающиеся на _t, следует считать зарезервированными, т.к. в заголовочные файлы POSIX могут содержать произвольные объявления типов с таким именем.

http://stackoverflow.com/questions/231760/what-does-a-type-followed-by-t-underscore-t-represent

"However, you should also note that POSIX defines a lot of extra type names ending in '_t', and reserves the suffix for the implementation. That means that if you are working on POSIX-related systems, defining your own type names with the convention is ill-advised. The system I work on has done it (for more than 20 years); we regularly get tripped up by systems defining types with the same name as we define."

http://stackoverflow.com/questions/4336710/commonly-accepted-variable-name-formatting-c-c

"Also beware of using the '_t' suffix for type names, especially in a POSIX environment. Actually, the rules on the linked page are more extensive than the rules in the C99 standard, but one line says "ANY HEADER suffix '_t'". That means that if you include any POSIX header in a POSIX environment - remembering that is a POSIX header as well as a standard C header - then you should not have any typedefs which end in _t [...]"

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(таблица в пункте 2.2)

понедельник, 24 января 2011 г.

Доказательство, что корректные программы с простыми мьютексами и атомарными переменными работают правильно (т.е. так, как ожидается - просто и понятно)
Разбираюсь с C++0x memory model. Нужно понять всё в деталях, чтобы корректно написать libref.

Working draft стандарта содержит очень сухие формулировки, которые трудно понять без пояснений. Вспомогательное чтение:

Hans Boehm, A Less Formal Explanation of the Proposed C++ Concurrency Memory Model (2006)

Clark Nelson, Hans-J. Boehm. Sequencing and the concurrency memory model (2006)

Clark Nelson, A finer-grained alternative to sequence points (2006)