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.

mentation <strong>of</strong> pipelining and certain types <strong>of</strong> parallel processing. The LabRAD<br />

Manager keeps track <strong>of</strong> all Contexts that all Servers have ever seen and, when a<br />

Client disconnects, it sends a Context Expiration Message to the relevant Servers<br />

to allow them to free up the memory that stores the data associated with the<br />

Context. Clients can also ask the Manager to send Context Expirations at any<br />

other time to make sure a Context can be safely reused without having to worry<br />

about a prior state. To allow for this assumption, all Context aware Servers (i.e.<br />

the ones that preserve state across Requests using Contexts) need to honor these<br />

Context Expirations.<br />

To assist with the development <strong>of</strong> Server Modules, a LabRAD API should<br />

provide at least basic Context management. In statically typed languages, this<br />

can be as simplistic as maintaining a single untyped pointer for each Context<br />

that the developer needs to manage by providing functions to create and free<br />

the required data-structures. In dynamically typed languages like Python this<br />

can be as comprehensive as automatically providing a dedicated dictionary (or<br />

hash-table) for each Context that can contain all relevant data.<br />

Contexts are also used to control the flow <strong>of</strong> Request handling.<br />

A Server<br />

must handle all Requests within a Context in the exact order in which they were<br />

received. To limit potential problems, this order should be enforced directly by the<br />

API. Requests in different Contexts can be interleaved to handle them in parallel.<br />

150

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

Saved successfully!

Ooh no, something went wrong!