SlideShare a Scribd company logo
Threading in Firebird and the Future 
Ann W. Harrison 
James A. Starkey
A Word of Thanks to our Sponsors
Why Threads? 
Improve multi-user performance 
Utilize multi-processor systems 
Databases are too easy to multi-thread
What are Atomic Instructions? 
Most machine instructions can be interrupted, allowing 
the world to change. 
Atomic instructions (e.g. CAS) run to completion. 
Essential for multi-thread performance.
Wasn’t Firebird Always Threaded? 
Earliest versions of shared server ran query for one 
user until it stalled before responding to next user. 
Not friendly. 
Multi-threaded server runs to the next wait or for a fixed 
period plus the time to make the database state 
consistent. 
Threads never run concurrently.
Firebird Classic 
Designed for VAX Clusters 
Multiple independent computers 
Shared intelligent disk controller 
Cluster-wide lock manager
Firebird Classic Multi-Processor 
Single Machine, Multi-Processor 
O/S schedules Firebird clients on processors 
Clients share 
Disk 
Lock manager 
Clients do not share 
Page Cache 
Metadata
Non-shared cache 
Firebird classic, super classic 
Client B wants 
page 123 
Client A changed 
page 123 
Yes, that is really a disk write
Shared cache - Superserver 
Client A changed 
page 123 
Client B wants 
page 123 
Client A releases 
lock on page 123 
Client B locks 
page 123 
1 
2 
3
Threading, 101 
Thread 
PC: Instruction stream of control 
Dedicated Stack (1 mb+) 
Thread specific data 
All threads share process memory 
Expensive to create, cheap to use 
(If you don’t thrash)
Threading 101 
Interlocked Instruction: Atomic compare and swap 
Compares given value to value at given address 
If equal, store new value at given address 
If not, fails and does nothing 
Interlocked instructions are the mortar of multi-threading
Threading 101 
Non-interlocked data structures 
Data structures managed only by interlocked 
instructions 
Completely non-blocking 
The fastest – and hardest – form of multi-programming
Threading 101 
RW-lock, aka SyncObject 
Can be locked for read/shared 
Can be locked for write/exclusive 
Blocks until access can be granted 
Monitor semantics: Thread doesn’t lock against itself 
Implemented with interlocked CAS
Threading 101 
Coarse grain multi-threading 
Single mutex controls an entire subsystem 
Individual data structures are not interlocked 
Fine grain multi-threading 
Individual RW-lock per data structure 
Allows many threads to share a subsystem
Threading 101 
Dedicated Thread 
Thread assigned specific task 
Garbage collector, network listener, etc. 
Client thread 
Thread executing user request 
Worker Thread 
Thread idle or executing user request 
Thread pool 
Manages worker threads
Threading Models 
Thread per connection 
Worker thread assigned at connection time 
Worker thread == Client thread 
Idle client threads consume resources 
Many connections => high contention
Threading Models 
Limited worker threads 
Limit active worker threads to approx. number of 
processors 
User requests queued until work thread becomes 
available 
If worker thread stalls (page read), thread pool can 
release next user request 
Utilizes processors without unnecessary contention
Threading Models 
Limited Worker Threads: 
Dedicated listener thread waits for readable socket 
Connection object (on listener thread) does socket 
read 
When packet is complete, connection object queue 
to thread pool 
When worker thread becomes available, connection 
object is executed
Threading Model 
Thread per connection is first step 
Limited worker threads is essential for scalability
Interbase Threads: The Beginning 
The concept of threads was known at the birth of 
Interbase, but no implementations existed on small 
machines. 
SMP didn’t exist in the mini or workstation world 
The initial version of Interbase used signals for 
communication 
User requests executed with “looper”; when a request 
stalled, another request could run
Interbase Theads: The V3 Disaster 
Apollo was the first workstation vendor with threads 
I implemented a VMS threading package 
Sun’s first attempt at threads didn’t even compile 
Interbase V3 was going to be mixed signals + threads 
Then disaster: Apollo Domain had unfixable 
architectural flaw mixing threads and signals 
A long slip ensued
Interbase Threads: V3 Reborn 
The engine was either threaded or signal based 
Dedicated threads for lock manager, event manager, 
etc. 
Server was thread per client 
Engine continued with coarse grain multi-threading
Firebird Threading: Vulcan 
Vulcan, now deceased, introduced limited fine grain 
multi-threading 
Threads synchronized with SyncObject: User mode 
read/write locks with monitor semantics 
SMP had arrived, followed shortly by processor based 
threads
Some Performance Lessons 
The goal is to saturate CPU, network, memory, and disk 
bandwidth simultaneously. 
There is no reason to run more worker threads than 
cores (and many reasons not to), but 
A stalled thread is an efficient way to maintain request 
state (death to “looper”!)
A Winning Architecture 
A single dedicated thread waiting for readable sockets 
Request starts are posted to thread manager for 
available worker thread 
When active worker threads drops below threshold, a 
pending request is assigned a worker thread 
A stalling thread checks in with thread manager to drop 
the number of active worker threads 
An unstalled request bumps the number of a.w.t.

More Related Content

PPTX
Orphans, Corruption, Careful Write, and Logging
Mind The Firebird
 
ODP
Using ТРСС to study Firebird performance
Mind The Firebird
 
PPT
Java script anywhere. What Nombas was doing pre-acquisition.
Brent Noorda
 
PPTX
Debugging the Web with Fiddler
Ido Flatow
 
PDF
Effectively Deploying MongoDB on AEM
Norberto Leite
 
PDF
Lessons Learned From Running Spark On Docker
Spark Summit
 
PPTX
Continuous Deployment with Cassandra
Michael Kjellman
 
PPTX
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Travis Wright
 
Orphans, Corruption, Careful Write, and Logging
Mind The Firebird
 
Using ТРСС to study Firebird performance
Mind The Firebird
 
Java script anywhere. What Nombas was doing pre-acquisition.
Brent Noorda
 
Debugging the Web with Fiddler
Ido Flatow
 
Effectively Deploying MongoDB on AEM
Norberto Leite
 
Lessons Learned From Running Spark On Docker
Spark Summit
 
Continuous Deployment with Cassandra
Michael Kjellman
 
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Travis Wright
 

What's hot (20)

PPTX
Right-Sizing your SQL Server Virtual Machine
heraflux
 
PPTX
AEM WITH MONGODB
Nate Nelson
 
PPTX
Migrate Oracle database to Amazon RDS
Jesus Guzman
 
ODP
Bcache and Aerospike
Anshu Prateek
 
PDF
Wordpress optimization
Almog Baku
 
PPTX
Life in the fast lane. Full speed XPages
Ulrich Krause
 
PPT
Life In The FastLane: Full Speed XPages
Ulrich Krause
 
PPTX
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
MongoDB
 
PPTX
Provisioning and automating high availability postgres on aws ec2 (1)
Payal Singh
 
PDF
Aem dispatcher – tips & tricks
Ashokkumar T A
 
PDF
PowerDNS with MySQL
I Goo Lee
 
PPTX
Migrating enterprise workloads to AWS
Tom Laszewski
 
PDF
Geographically Distributed Multi-Master MySQL Clusters
Continuent
 
PDF
Deep Dive into RDS PostgreSQL Universe
Jignesh Shah
 
PDF
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
DataStax Academy
 
PDF
Aem maintenance
Ashokkumar T A
 
PPT
Scaling Up and Out your Virtualized SQL Servers
heraflux
 
KEY
From 100s to 100s of Millions
Erik Onnen
 
PPT
J2EE Performance And Scalability Bp
Chris Adkin
 
PPTX
IaaS for DBAs in Azure
Kellyn Pot'Vin-Gorman
 
Right-Sizing your SQL Server Virtual Machine
heraflux
 
AEM WITH MONGODB
Nate Nelson
 
Migrate Oracle database to Amazon RDS
Jesus Guzman
 
Bcache and Aerospike
Anshu Prateek
 
Wordpress optimization
Almog Baku
 
Life in the fast lane. Full speed XPages
Ulrich Krause
 
Life In The FastLane: Full Speed XPages
Ulrich Krause
 
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
MongoDB
 
Provisioning and automating high availability postgres on aws ec2 (1)
Payal Singh
 
Aem dispatcher – tips & tricks
Ashokkumar T A
 
PowerDNS with MySQL
I Goo Lee
 
Migrating enterprise workloads to AWS
Tom Laszewski
 
Geographically Distributed Multi-Master MySQL Clusters
Continuent
 
Deep Dive into RDS PostgreSQL Universe
Jignesh Shah
 
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
DataStax Academy
 
Aem maintenance
Ashokkumar T A
 
Scaling Up and Out your Virtualized SQL Servers
heraflux
 
From 100s to 100s of Millions
Erik Onnen
 
J2EE Performance And Scalability Bp
Chris Adkin
 
IaaS for DBAs in Azure
Kellyn Pot'Vin-Gorman
 
Ad

Viewers also liked (20)

PDF
How does Linked Open Data change the publishing landscape?
Quentin Reul
 
PDF
FHWA MOU with the State of Alaska Regarding Delegation of CEs.
artba
 
PDF
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
artba
 
PDF
Artba Senate Finance Committee May
artba
 
PPTX
Accessibility Matters: Making Your Product Available to Everyone
Char James-Tanny
 
PDF
09/25/13: Senate EPW Highway Trust Fund Hearing
artba
 
PDF
Suggested Best Practices for Design-Build in Transportation Construction
artba
 
PDF
Accessibility Matters - Supplemental Links
Char James-Tanny
 
PDF
Coalition Letter to House Energy and Commerce Committee Leaders on Chemical S...
artba
 
PDF
02/12/14: Testimony to Senate Environment & Public Works Committee
artba
 
PDF
Coalition Comments on OSHA Clarification to Workplace Injury and Illness Regu...
artba
 
PDF
Matapouri beach house
Simon Devitt Photographer
 
PDF
Comments Objecting to ESA protections for the Long-Eared Bat
artba
 
PDF
Multi-Industry Letter to Congress on EPA Ozone Standards
artba
 
PPTX
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
Todd DeLuca, MTSC
 
PDF
New York Times Ad opposing tighter ozone standards
artba
 
PPTX
The Experience Comes First (STC New England - InterChange2016)
Deborah Sauer
 
PDF
Git Going With DVCS v1.1
Matthew McCullough
 
PPT
How to translate patient information leaflets
Maja Źróbecka, MITI
 
PDF
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Simon Devitt Photographer
 
How does Linked Open Data change the publishing landscape?
Quentin Reul
 
FHWA MOU with the State of Alaska Regarding Delegation of CEs.
artba
 
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
artba
 
Artba Senate Finance Committee May
artba
 
Accessibility Matters: Making Your Product Available to Everyone
Char James-Tanny
 
09/25/13: Senate EPW Highway Trust Fund Hearing
artba
 
Suggested Best Practices for Design-Build in Transportation Construction
artba
 
Accessibility Matters - Supplemental Links
Char James-Tanny
 
Coalition Letter to House Energy and Commerce Committee Leaders on Chemical S...
artba
 
02/12/14: Testimony to Senate Environment & Public Works Committee
artba
 
Coalition Comments on OSHA Clarification to Workplace Injury and Illness Regu...
artba
 
Matapouri beach house
Simon Devitt Photographer
 
Comments Objecting to ESA protections for the Long-Eared Bat
artba
 
Multi-Industry Letter to Congress on EPA Ozone Standards
artba
 
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
Todd DeLuca, MTSC
 
New York Times Ad opposing tighter ozone standards
artba
 
The Experience Comes First (STC New England - InterChange2016)
Deborah Sauer
 
Git Going With DVCS v1.1
Matthew McCullough
 
How to translate patient information leaflets
Maja Źróbecka, MITI
 
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Simon Devitt Photographer
 
Ad

Similar to Threading through InterBase, Firebird, and beyond (20)

ODP
Concept of thread
Munmun Das Bhowmik
 
PPTX
Threading.pptx
BalasundaramSr
 
PPTX
Operating Systems R20 Unit 2.pptx
Prudhvi668506
 
PPT
Operating System 4
tech2click
 
PPT
Operating System 4 1193308760782240 2
mona_hakmy
 
PDF
threads (1).pdfmjlkjfwjgliwiufuaiusyroayr
abhinandpk2405
 
ODP
Multithreading 101
Tim Penhey
 
PPTX
Interactions complicate debugging
Syed Zaid Irshad
 
PPTX
Lecture 3 threads
Kumbirai Junior Muzavazi
 
PPTX
Networking threads
Nilesh Pawar
 
DOC
Threads
chrisjosewanjira
 
PPTX
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
babayaga920391
 
PPT
Treads
nayanashetty7
 
PDF
Concurrency in java
Saquib Sajid
 
KEY
Threaded Awesome
Aman Gupta
 
PPTX
Threads, signal and socket system calls.pptx
JohnNderi1
 
PDF
Multithreading 101
Tim Penhey
 
PDF
Here comes the Loom - Ya!vaConf.pdf
Krystian Zybała
 
PDF
Thread
Mohd Arif
 
Concept of thread
Munmun Das Bhowmik
 
Threading.pptx
BalasundaramSr
 
Operating Systems R20 Unit 2.pptx
Prudhvi668506
 
Operating System 4
tech2click
 
Operating System 4 1193308760782240 2
mona_hakmy
 
threads (1).pdfmjlkjfwjgliwiufuaiusyroayr
abhinandpk2405
 
Multithreading 101
Tim Penhey
 
Interactions complicate debugging
Syed Zaid Irshad
 
Lecture 3 threads
Kumbirai Junior Muzavazi
 
Networking threads
Nilesh Pawar
 
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
babayaga920391
 
Concurrency in java
Saquib Sajid
 
Threaded Awesome
Aman Gupta
 
Threads, signal and socket system calls.pptx
JohnNderi1
 
Multithreading 101
Tim Penhey
 
Here comes the Loom - Ya!vaConf.pdf
Krystian Zybała
 
Thread
Mohd Arif
 

More from Mind The Firebird (20)

ODP
Tips for using Firebird system tables
Mind The Firebird
 
PDF
Using Azure cloud and Firebird to develop applications easily
Mind The Firebird
 
PDF
A year in the life of Firebird .Net provider
Mind The Firebird
 
ODP
How Firebird transactions work
Mind The Firebird
 
PDF
SuperServer in Firebird 3
Mind The Firebird
 
ODP
Copycat presentation
Mind The Firebird
 
ODP
Overview of RedDatabase 2.5
Mind The Firebird
 
PDF
Creating logs for data auditing in FirebirdSQL
Mind The Firebird
 
ODP
Firebird Performance counters in details
Mind The Firebird
 
PDF
Understanding Numbers in Firebird SQL
Mind The Firebird
 
PDF
New SQL Features in Firebird 3, by Vlad Khorsun
Mind The Firebird
 
ODP
Firebird release strategy and roadmap for 2015/2016
Mind The Firebird
 
PPTX
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Mind The Firebird
 
PDF
Working with Large Firebird databases
Mind The Firebird
 
PDF
Stored procedures in Firebird
Mind The Firebird
 
PDF
Firebird on Linux
Mind The Firebird
 
PPTX
Superchaging big production systems on Firebird: transactions, garbage, maint...
Mind The Firebird
 
PDF
Firebird meets NoSQL
Mind The Firebird
 
PDF
Continuous Database Monitoring with the Trace API
Mind The Firebird
 
PDF
Firebird 3 Windows Functions
Mind The Firebird
 
Tips for using Firebird system tables
Mind The Firebird
 
Using Azure cloud and Firebird to develop applications easily
Mind The Firebird
 
A year in the life of Firebird .Net provider
Mind The Firebird
 
How Firebird transactions work
Mind The Firebird
 
SuperServer in Firebird 3
Mind The Firebird
 
Copycat presentation
Mind The Firebird
 
Overview of RedDatabase 2.5
Mind The Firebird
 
Creating logs for data auditing in FirebirdSQL
Mind The Firebird
 
Firebird Performance counters in details
Mind The Firebird
 
Understanding Numbers in Firebird SQL
Mind The Firebird
 
New SQL Features in Firebird 3, by Vlad Khorsun
Mind The Firebird
 
Firebird release strategy and roadmap for 2015/2016
Mind The Firebird
 
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Mind The Firebird
 
Working with Large Firebird databases
Mind The Firebird
 
Stored procedures in Firebird
Mind The Firebird
 
Firebird on Linux
Mind The Firebird
 
Superchaging big production systems on Firebird: transactions, garbage, maint...
Mind The Firebird
 
Firebird meets NoSQL
Mind The Firebird
 
Continuous Database Monitoring with the Trace API
Mind The Firebird
 
Firebird 3 Windows Functions
Mind The Firebird
 

Recently uploaded (20)

PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Presentation about variables and constant.pptx
safalsingh810
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 

Threading through InterBase, Firebird, and beyond

  • 1. Threading in Firebird and the Future Ann W. Harrison James A. Starkey
  • 2. A Word of Thanks to our Sponsors
  • 3. Why Threads? Improve multi-user performance Utilize multi-processor systems Databases are too easy to multi-thread
  • 4. What are Atomic Instructions? Most machine instructions can be interrupted, allowing the world to change. Atomic instructions (e.g. CAS) run to completion. Essential for multi-thread performance.
  • 5. Wasn’t Firebird Always Threaded? Earliest versions of shared server ran query for one user until it stalled before responding to next user. Not friendly. Multi-threaded server runs to the next wait or for a fixed period plus the time to make the database state consistent. Threads never run concurrently.
  • 6. Firebird Classic Designed for VAX Clusters Multiple independent computers Shared intelligent disk controller Cluster-wide lock manager
  • 7. Firebird Classic Multi-Processor Single Machine, Multi-Processor O/S schedules Firebird clients on processors Clients share Disk Lock manager Clients do not share Page Cache Metadata
  • 8. Non-shared cache Firebird classic, super classic Client B wants page 123 Client A changed page 123 Yes, that is really a disk write
  • 9. Shared cache - Superserver Client A changed page 123 Client B wants page 123 Client A releases lock on page 123 Client B locks page 123 1 2 3
  • 10. Threading, 101 Thread PC: Instruction stream of control Dedicated Stack (1 mb+) Thread specific data All threads share process memory Expensive to create, cheap to use (If you don’t thrash)
  • 11. Threading 101 Interlocked Instruction: Atomic compare and swap Compares given value to value at given address If equal, store new value at given address If not, fails and does nothing Interlocked instructions are the mortar of multi-threading
  • 12. Threading 101 Non-interlocked data structures Data structures managed only by interlocked instructions Completely non-blocking The fastest – and hardest – form of multi-programming
  • 13. Threading 101 RW-lock, aka SyncObject Can be locked for read/shared Can be locked for write/exclusive Blocks until access can be granted Monitor semantics: Thread doesn’t lock against itself Implemented with interlocked CAS
  • 14. Threading 101 Coarse grain multi-threading Single mutex controls an entire subsystem Individual data structures are not interlocked Fine grain multi-threading Individual RW-lock per data structure Allows many threads to share a subsystem
  • 15. Threading 101 Dedicated Thread Thread assigned specific task Garbage collector, network listener, etc. Client thread Thread executing user request Worker Thread Thread idle or executing user request Thread pool Manages worker threads
  • 16. Threading Models Thread per connection Worker thread assigned at connection time Worker thread == Client thread Idle client threads consume resources Many connections => high contention
  • 17. Threading Models Limited worker threads Limit active worker threads to approx. number of processors User requests queued until work thread becomes available If worker thread stalls (page read), thread pool can release next user request Utilizes processors without unnecessary contention
  • 18. Threading Models Limited Worker Threads: Dedicated listener thread waits for readable socket Connection object (on listener thread) does socket read When packet is complete, connection object queue to thread pool When worker thread becomes available, connection object is executed
  • 19. Threading Model Thread per connection is first step Limited worker threads is essential for scalability
  • 20. Interbase Threads: The Beginning The concept of threads was known at the birth of Interbase, but no implementations existed on small machines. SMP didn’t exist in the mini or workstation world The initial version of Interbase used signals for communication User requests executed with “looper”; when a request stalled, another request could run
  • 21. Interbase Theads: The V3 Disaster Apollo was the first workstation vendor with threads I implemented a VMS threading package Sun’s first attempt at threads didn’t even compile Interbase V3 was going to be mixed signals + threads Then disaster: Apollo Domain had unfixable architectural flaw mixing threads and signals A long slip ensued
  • 22. Interbase Threads: V3 Reborn The engine was either threaded or signal based Dedicated threads for lock manager, event manager, etc. Server was thread per client Engine continued with coarse grain multi-threading
  • 23. Firebird Threading: Vulcan Vulcan, now deceased, introduced limited fine grain multi-threading Threads synchronized with SyncObject: User mode read/write locks with monitor semantics SMP had arrived, followed shortly by processor based threads
  • 24. Some Performance Lessons The goal is to saturate CPU, network, memory, and disk bandwidth simultaneously. There is no reason to run more worker threads than cores (and many reasons not to), but A stalled thread is an efficient way to maintain request state (death to “looper”!)
  • 25. A Winning Architecture A single dedicated thread waiting for readable sockets Request starts are posted to thread manager for available worker thread When active worker threads drops below threshold, a pending request is assigned a worker thread A stalling thread checks in with thread manager to drop the number of active worker threads An unstalled request bumps the number of a.w.t.