ข้ามไปยังเนื้อหา

Glossary

EnglishThai Styleหมายเหตุ
Goroutinegoroutineunit of concurrent work ใน Go
Schedulerschedulerจัดสรร goroutine ลง OS thread
Runtimeruntimeระบบ runtime ของ Go
Stackstackmemory สำหรับ local variable และ function call
Heapheapmemory สำหรับ object ที่อายุยาว
Garbage CollectorGarbage Collector / GCทำความสะอาด heap อัตโนมัติ
Escape AnalysisEscape Analysisตัดสินใจว่า object อยู่ stack หรือ heap
Context Switchcontext switchสลับระหว่าง goroutine
Preemptionpreemptionบังคับหยุด goroutine เพื่อให้ตัวอื่นทำงาน
EnglishThai Styleหมายเหตุ
Memory Allocationmemory allocationจองหน่วยความจำ
Memory Layoutmemory layoutรูปแบบการวางข้อมูลใน memory
Heap Allocationheap allocationจอง memory บน heap
Stack Allocationstack allocationจอง memory บน stack
Stack Growthstack growthstack ขยายขนาดแบบ dynamic
Pointerpointerตัวแปรที่เก็บ memory address
Work Stealingwork stealingscheduler ขโมยงานจาก P ตัวอื่น
EnglishThai Styleหมายเหตุ
Channelchannelท่อสื่อสารระหว่าง goroutine
Mutexmutexlock สำหรับ mutual exclusion
RWMutexRWMutexread/write mutex
Atomicatomicoperation ที่ไม่สามารถถูก interrupt ได้
WaitGroupWaitGroupรอ goroutine หลายตัวให้เสร็จ
Selectselectรับจาก channel หลายตัวพร้อมกัน
Deadlockdeadlockgoroutine รอกันเองไม่มีที่สิ้นสุด
Race Conditionrace conditiongoroutine หลายตัวเข้าถึง shared state พร้อมกัน
Symbolความหมาย
GGoroutine — unit of work
MMachine — OS thread
PProcessor — scheduling context
EnglishThai Styleหมายเหตุ
Interfaceinterfaceชุด method signatures
Type Assertiontype assertionแปลง interface เป็น concrete type
Reflectionreflectionตรวจสอบ type ณ runtime
Assemblyassemblyภาษา assembly ที่ Go compiler ผลิต
Compilercompilerแปลง Go source เป็น binary
Linkerlinkerรวม object files เข้าด้วยกัน
หลีกเลี่ยงใช้แทน
ดำเนินการจัดสรรหน่วยความจำallocate memory
กระบวนการเก็บกวาดหน่วยความจำGC
หน่วยประมวลผลแบบเบาgoroutine
กระบวนการเรียกใช้execute
ตัวชี้pointer
หน่วยความจำแบบกองซ้อนstack
หน่วยความจำแบบฮีปheap
ตัวจัดกำหนดการscheduler