Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Программирование под Unix/Linux > что сейчас используют для разработки серверов -


Автор: boostcoder 3.9.2011, 19:29
всем привет.

около 2ух лет не писал на Си ничего серьезного, и выпал из темы. какая либа для полинга событий сейчас актуальна? необходима поддержка win/lin.

использовал libevent.
забил запрос в гугл, и нашел http://software.schmorp.de/pkg/libev.html.
так там в шапке такое дело записано:
Цитата

A full-featured and high-performance (see benchmark) event loop that is loosely modelled after libevent, but without its limitations and bugs.

кто-то в курсе, о каких ограничениях и багах(неизлечимых) идет речь?

у нее, кстати, есть http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#C_SUPPORT smile 

спасибо.

Автор: boostcoder 3.9.2011, 19:46
но с поддержкой вендус у libev полная *опа:
Цитата

Win32 doesn't support any of the standards (e.g. POSIX) that libev requires, and its I/O model is fundamentally incompatible with the POSIX model. Libev still offers limited functionality on this platform in the form of the EVBACKEND_SELECT backend, and only supports socket descriptors. This only applies when using Win32 natively, not when using e.g. cygwin. Actually, it only applies to the microsofts own compilers, as every compiler comes with a slightly differently broken/incompatible environment.

Lifting these limitations would basically require the full re-implementation of the I/O system. If you are into this kind of thing, then note that glib does exactly that for you in a very portable way (note also that glib is the slowest event library known to man).

There is no supported compilation method available on windows except embedding it into other applications.

Sensible signal handling is officially unsupported by Microsoft - libev tries its best, but under most conditions, signals will simply not work.

Not a libev limitation but worth mentioning: windows apparently doesn't accept large writes: instead of resulting in a partial write, windows will either accept everything or return ENOBUFS if the buffer is too large, so make sure you only write small amounts into your sockets (less than a megabyte seems safe, but this apparently depends on the amount of memory available).

Due to the many, low, and arbitrary limits on the win32 platform and the abysmal performance of winsockets, using a large number of sockets is not recommended (and not reasonable). If your program needs to use more than a hundred or so sockets, then likely it needs to use a totally different implementation for windows, as libev offers the POSIX readiness notification model, which cannot be implemented efficiently on windows (due to Microsoft monopoly games).


никаким IOCP и не пахнет...

Автор: MAKCim 3.9.2011, 21:37
чем libevent версии 2+ не устраивает?
там вроде iocp пахнет ;)

Автор: boostcoder 3.9.2011, 23:41
Цитата(MAKCim @  3.9.2011,  21:37 Найти цитируемый пост)
чем libevent версии 2+ не устраивает?

не то чтоб не устраивает. но еще пол года назад помню, что поддержки IOCP не было... сейчас, вроде, по заявлению есть. но кто-то реально может подтвердить работоспособность IOCP?

Цитата(MAKCim @  3.9.2011,  21:37 Найти цитируемый пост)
там вроде iocp пахнет ;)

в том-то и дело, что только пахнет ;)

Автор: MAKCim 4.9.2011, 09:06
либо проверить, либо поверить разработчикам, что все работает

2-ая версия была unstable весьма долго, думаю сейчас все, что заявлено, должно работать нужным образом

Автор: boostcoder 4.9.2011, 10:31
Цитата(MAKCim @  4.9.2011,  09:06 Найти цитируемый пост)
2-ая версия была unstable весьма долго

ну да. в конце 2009го помню что уже видел альфы. хочется думать что за почти два года допилили.

всем спасибо.
вопрос закрыт.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)