انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-006-L05

أي خيط ينفّذ مرحلتي؟

  • الدرس 5 من 6
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

choose executors deliberately.

الموضوعات المخطط لها

  • Without an executor, async methods use the common ForkJoinPool, sized for CPU work.
  • Blocking I/O in the common pool starves everything else that uses it, including parallel streams.
  • Pass a dedicated executor for blocking calls: supplyAsync(task, ioPool).
  • Non-Async methods (thenApply) run on whichever thread completes the previous stage (or the caller if already complete); thenApplyAsync hops to a pool.
  • Never call join() inside a stage on a pool that may be exhausted.
تفاصيل المخطط المبدئي

عرض عملي

a diagram: HTTP calls on an ioPool; light mapping stays on the completing thread.

اختبر فهمك

Why avoid blocking I/O on the common pool?

أظهر الإجابة

It is small and shared; blocking starves other work.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.