Cisco CloudCenter: Get the Hybrid IT Advantage

Threaded Code

Definition - What does Threaded Code mean?

Threaded code is a compiler implementation technique that is used to implement virtual machine interpreters. The code that is generated by the threaded code mostly contains calls to subroutines. This code could also be a simple sequence of machine call instructions or perhaps a code that needs to be processed by a machine interpreter. Threaded code is the implemented method in programming languages like FORTH, most implementations of BASIC and some versions of COBOL. One of the prominent features of threaded code is that compared to other code generation methods, it has a higher code density. At the same time, the execution speed is slightly slower than the codes generated by alternative methods.

Techopedia explains Threaded Code

Threaded code is mostly implemented using the following models:

  • Direct Threaded Code: The program code is a normal vector of procedure pointers to call arranged in the order in which they appear.
  • Indirect Threaded Code: Makes the representation of the compiled program with the help of address pointers. The representation makes use of vector of addresses to descriptors and not the addresses of the execution code. The descriptors, in turn, point to intended execution code.
  • Subroutine Threaded Code: Compared to other methods, subroutine threaded code has code representations that can be executed directly by the CPU. In this method, the vector used consists of JSR or CALL instructions instead of a vector of addresses.
  • Token Threaded Code: Makes use of the ThreeStarProgramming approach for interpreting the compiled representations. The representations are mostly restricted to less than 256 virtual instructions. As a result of this restriction, token threaded code is also known as byte code.
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.