27.09.2014 Views

PDF (double-sided) - Physics Department, UCSB - University of ...

PDF (double-sided) - Physics Department, UCSB - University of ...

PDF (double-sided) - Physics Department, UCSB - University of ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.4.2 LabRAD Manager<br />

The LabRAD Manager acts as the central routing agent for all LabRAD traffic.<br />

This makes it a potential bottleneck for the entire system and thus extra care had<br />

to be employed when designing it to ensure maximal performance. The LabRAD<br />

Manager was written in Delphi, a version <strong>of</strong> Object Pascal that provides RAD<br />

(Rapid Application Development) capabilities through visual designers that assist<br />

in the design <strong>of</strong> the user interface. Delphi has not received much attention in<br />

the US market, but in Europe it is highly valued as a very efficient language<br />

with a compiler that produces code that rivals any modern C++ compiler’s in<br />

execution performance. It provides the usual high-performance features like code<br />

optimization, data alignment, inlined Assembly, etc.<br />

Apart from optimized memory management, one major point <strong>of</strong> concern was<br />

a well-designed thread layout for the application. A first approach that dedicated<br />

one thread to each network connection had to be abandoned due to the high cost <strong>of</strong><br />

Windows context switching (switching between threads). Making the application<br />

dual-threaded instead yielded an order <strong>of</strong> magnitude performance improvement.<br />

The first thread, the network thread, is dedicated to routing all traffic and handling<br />

Requests to the Manager and the Registry Server Module. It uses direct access<br />

to the event-based, non-blocking methods provided by the Windows Sockets 2<br />

143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!