GVL (Global VM Lock, முன்னர் GIL) MRI Ruby-ல் ஒரு நேரத்தில் ஒரே ஒரு thread-ஐ Ruby code செயல்படுத்த அனுமதிக்கிறது — எனவே threads உண்மையான CPU parallelism வழங்காது. ஆனால் GVL I/O சமயத்தில் விடுவிக்கப்படுகிறது, எனவே threads உண்மையில் I/O-bound வேலைக்கு உதவுகின்றன. CPU parallelism-க்கு, நீங்கள் பல processes பயன்படுத்துகிறீர்கள். இது Python-ன் GIL சூழ்நிலையை பிரதிபலிக்கிறது.
GVL: ஒரு நேரத்தில் ஒரே ஒரு thread Ruby code-ஐ இயக்குகிறது
MRI (the standard Ruby) has a GLOBAL VM LOCK:
→ only ONE thread executes Ruby code at any instant (no CPU parallelism from threads)
→ BUT the GVL is RELEASED during blocking I/O (network, file, DB)
So: threads help for I/O-bound work, NOT for CPU-bound work.
