التثبيت (Pinning) ومزالق أخرى
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
know when virtual threads do not help.
الموضوعات المخطط لها
- Pinning: a virtual thread cannot unmount while blocked, holding its carrier. Causes include blocking inside
synchronizedon older JDKs and native frames; newer JDKs reducesynchronizedpinning (verify version). - Diagnose with JFR's virtual thread pinned event or
-Djdk.tracePinnedThreads(verify flags). - CPU-bound work gains nothing; carriers equal about the number of cores.
- Downstream limits: 10,000 virtual threads can hit a 10-connection database pool, so the bottleneck moves.
- Use semaphores or pool limits to protect downstream resources.
تفاصيل المخطط المبدئي
عرض عملي
a table: workload / benefit — blocking HTTP: high; JDBC with small pool: bounded by pool; CPU loop: none.
اختبر فهمك
Why can a database pool still be the bottleneck?
أظهر الإجابة
Many virtual threads compete for the same fixed number of connections.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.