ArticleslgStudy

computer science

Flex machine

Flex machine is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Flex machine rather than just read about it. In short: The Flex Computer System was developed by Michael Foster and Ian Currie of Royal Signals and Radar Establishment (RSRE) in Malvern, England, during the late 1970s and 1980s. It used a tagged storage scheme to implement a capability architecture, and was designed for the safe and efficient implementation of strongly typed procedures in high-level programming languages such as ALGOL 68 and Ada.

Key takeaways

  • Flex machine belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Flex machine to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Flex machine from memory before moving on to harder problems.

Reference excerpt

The Flex Computer System was developed by Michael Foster and Ian Currie of Royal Signals and Radar Establishment (RSRE) in Malvern, England, during the late 1970s and 1980s. It used a tagged storage scheme to implement a capability architecture, and was designed for the safe and efficient implementation of strongly typed procedures in high-level programming languages such as ALGOL 68 and Ada.

Description The original Flex hardware was custom and microprogrammable, with an operating system, (modular) compiler, editor and filing system all written in ALGOL 68RS. The microcode enforced a tagged architecture to distinguish between different types of data and was described as providing "a protection structure equivalent to that of capability machines". The microcode was entirely responsible for storage allocation, deallocation and garbage collection. By tagging pointers, the microcode could make them "unforgeable" by program operations, and this immediately precluded a whole class of errors arising from the misuse (deliberate or accidental) of pointers, or from compiler bugs.

Memory and garbage collection Memory was allocated in blocks of different types that supported only certain kinds of operation. Block types were divided into two principal groups: those concerned with procedures and those concerned with data. Procedures were described by closure blocks that referenced the code, non-locals and constants, and could only be invoked. Invocation would cause a workspace block to be allocated containing local variables and the evaluation stack for a procedure. Data would reside in blocks distinct from blocks holding program code. However, unlike certain other capability systems, Flex allowed both pointers and data values to be stored at the same time within the same block, relying on the tagging of pointers to prevent conflation with data. In contrast, the Plessey System 250 employed dedicated capability and data segments, along with dedicated capability and data registers. Pointers were only able to reference whole blocks without supplementary information. Individual data values would be accessed using a reference involving a pointer and an offset or displacement within a block. Elements in a vector would be accessed using a pointer and a displacement constrained by an upper bound, and array access would involve pointer, displacement, bounds and stride information. Blocks would contain metadata in the form of overhead words which, although appearing at the start of blocks in physical memory, would be invisible to code accessing these blocks whose offsets would be adjusted transparently to skip such overhead regions. The whole scheme allowed abstract data types and for interfaces to privileged code to be safely implemented, as data items and the procedures permitted to access them could be bound together and the resulting capability passed freely around. The capability would grant access to the procedures, but could not be used in any way to obtain access to the code or data. Indeed, just as the operating system could employ such mechanisms to uphold its privilege and be protected from callers, procedures in user programs could similarly employ these mechanisms to act like an operating system to their own callers. Since such mechanisms were provided at the hardware level, as opposed to depending on code generated for any particular programming language, information hiding restrictions stipulated by languages such as Modula and Ada could not be circumvented by using code written in low-level or permissive languages, these purposefully not supporting such restrictions, to interface to high-level language code. Memory blocks in Flex were garbage collected, with the collector implemented in microcode using a mark and sweep approach. This would scan the known live (or active) blocks for pointers, made easier by the presence of the tag bits distinguishing pointers from data words. Referenced blocks would then be marked as live and compaction would occur, situating the remaining live blocks at the start of the system's memory and updating the system's own records of block locations. A notable feature of Flex was the notion of firm and shaky pointers: the former causing blocks to be marked as live during collection, and the latter acting as a form of weak reference. Where all pointers to a given block were marked as shaky, such a block could be freed at the next garbage collection. Each of the shaky pointers involved would then be overwritten with a nil value Shaky pointers were also used, for example, for cached disc blocks or to provide a list or chain of spare procedure workspaces. Garbage collection would suspend execution of code for approximately half a second in the second "laboratory model" implementation of the system with one megabyte of memory. It was a process whose duration was directly proportional to the size of the memory, increasing linearly with store size. On a two megabyte PERQ system, the measured time for garbage collection was, on average, between 1.1 and 1.5 seconds. An example scenario of "two long Algol68 compilations in parallel with normal text editing" would cause collection every 45 seconds or so, this recovering 1.2 megabytes of free memory on each occasion.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Flex machine

Start with the simplest possible case. Write down what Flex machine claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Flex machine before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Flex machine ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Flex machine

In research
Flex machine appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Flex machine in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Flex machine is common in secondary-school and first-year university syllabi. It links to neighbouring topics Capability systems, Computers designed in the United Kingdom, Mainframe computers, so understanding it makes those chapters shorter.
In everyday life
Look for Flex machine outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Flex machine” →

How to study Flex machine in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Flex machine means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Flex machine out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Flex machine in simple terms?

The Flex Computer System was developed by Michael Foster and Ian Currie of Royal Signals and Radar Establishment (RSRE) in Malvern, England, during the late 1970s and 1980s. It used a tagged storage scheme to implement a capability architecture, and was designed for the safe and efficient implement…

Why does Flex machine matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Flex machine?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Flex machine.

Tags

  • Capability systems
  • Computers designed in the United Kingdom
  • Mainframe computers
  • Malvern, Worcestershire
  • Science and technology in Worcestershire

Keep exploring