28.10.2014 Views

Synergy User Manual and Tutorial. - THE CORE MEMORY

Synergy User Manual and Tutorial. - THE CORE MEMORY

Synergy User Manual and Tutorial. - THE CORE MEMORY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Synergy</strong> <strong>User</strong> <strong>Manual</strong> <strong>and</strong> <strong>Tutorial</strong><br />

Owin<br />

Saber<br />

Sarlac<br />

Luke<br />

("Bob", 12, 34.56)<br />

(102, 73, 36, 125, 67.5, 1000)<br />

Tuple Space<br />

("Sally", "123 Broad St",<br />

"Philadelphia PA 19024",<br />

"555-123-4567")<br />

Tuples are placed in <strong>and</strong> retrieved from tuple spaces by function calls, previously<br />

described, that match a pattern from a template. A template is essentially a tuple that is<br />

used to express a pattern. The template:<br />

(? A, 12, ? B)<br />

where A is a string <strong>and</strong> B is a double, matches:<br />

(name, number, fraction) = (“Bob”, 12, 34.56)<br />

However, this template will not match the other tuples in the example above. The<br />

general rules for a Linda tuple were stated previously. This is called an associative<br />

memory because elements or tuples in the memory are accessed by associating them,<br />

synonymously, with a pattern in their content as opposed to being referenced by a<br />

memory address or physical location.<br />

Active tuples in Linda are based on the generative communication model, where<br />

dynamically spawned processes are turned into data upon completion of their task. The<br />

eval(“worker”, worker()) function will leave a tuple in the tuple space with two fields<br />

from the called worker function:<br />

worker(){<br />

// perform task<br />

86

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

Saved successfully!

Ooh no, something went wrong!