Designing High-Performance Networking Applications: Essential Insights for Developers of IXP2XXX Network Processor-based Systems

Chapter 6: Critical Sections and Packet Ordering

First things first, but not necessarily in that order.
Doctor Who

The previous chapter described how multiple threads across microengines run in parallel to achieve the desired performance. However, one well-known problem with using parallelism is synchronizing updates to shared data structures.

To understand the synchronization problem, consider an application that classifies packets into flows and meters packets belonging to the same flow using a token bucket algorithm. The application uses a separate token bucket for each flow on the network. The parameters associated with a token bucket, such as the number of tokens and update rate, are stored in a per-flow data structure. Depending on the granularity of the flow classification, the number of flows could be very large. Therefore, these per-flow data structures are typically stored in external SRAM or DRAM. Each packet-processing thread reads, modifies, and writes the parameters in the flow data structure once per packet.

Since multiple threads across microengines may be processing packets belonging to the same flow, they must synchronize any updates to the flow data structure. Each thread needs to obtain exclusive access to the data structure, read, modify, and write it back to memory. The code executed by a thread while it has exclusive access to the data structure is called a critical section. This chapter presents different techniques for implementing critical sections.

Locks and Semaphores

Traditionally, applications have relied on locks and semaphores for synchronizing updates to shared data structures. IXP2XXX network processors support atomic instructions in SRAM, such...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Thread Rolling Dies
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.