reverse_linked_list-225x225

Reversing a Singly Linked List

In all my years as a software developer, reversing a singly linked list is not something I’ve had to do. But it is a commonly asked question in interviews for programming positions. Of course the easy solution to the problem is to place items in a Standard C++ collection, like a vector, then apply the reverse() function to the…

thread-queue-225x225

Multithreaded Work Queue in C++

In my previous blog Java Style Thread Class in C++ I discussed how to develop a C++ class that enables you to create Pthread based objects that resemble Java threads. The next step to building a multithreaded application is to devise a means to distribute tasks between threads so they can be processed concurrently. Queues are good devices for transferring work items from one…

c-threads-225x225

Java Style Thread Class in C++

Java provides the Thread class that enables developers to easily create multiple threads in Java applications. Pthreads is commonly used for multithreaded programming in C and C++, but this API is procedural and somewhat less convenient to use than Java’s object oriented thread interface. However, it is possible to mimic Java threads behaviors by wrapping Pthreads calls in a C++ class…

libpcap-225x225

Develop a Packet Sniffer with libpcap

Libpcap is an open source C library that provides an API for capturing packets directly from the datalink layer of Unix derived operating systems. It is used by popular packet capture applications such as tcpdump and snort that enables them to run on just about any flavor of Unix. Here’s an example of a simple packet sniffer application based on…