Blog

Implementing an asynchronous, epoll based network client with Tango on Linux

posted by in Category: Code Talk

A way that provides much better performance for a big number of simultaneously handled socket connections than starting a handler thread for each connection is to handle all connections in the main thread, using Linux’ epoll interface in combination with non-blocking socket I/O. Tango’s EpollSelector is built on top of epoll and provides a pretty good D interface for it. read more

The opApply() recipe

posted by in Category: Code Talk

The D programming language climbed to #27 in Tiobe’s Programming Community Index for June 2010. Here with some tips on this up-and-coming language is our very own David Eckardt. In D, a class or struct can provide foreach iteration over its instances by implementing a special method named opApply(). This is an extremely useful feature; however, understanding the semantics of opApply is pretty hard if you are new to it. Unfortunately, the description on the Digital Mars page is too brief to get the point, while the famous book Learn to Tango with D announces it, but then completely lacks the section. But the use of opApply() can be explained [...] read more