سوال ۹۷ کنکور ارشد مهندسی کامپیوتر ۱۴۰۵
هدف اصلی زبانهای برنامهنویسی از روش برنامهنویسی ناهمگام چیست؟
پاسخ صحیح: گزینهٔ D — همپوشانی IO
Asynchronous programming (callbacks, promises/futures, async/await, event loops) is a language-level facility whose defining purpose is to keep the processor doing useful work while slow I/O operations are pending — that is, to overlap I/O with computation (and to overlap multiple outstanding I/O requests with one another). Instead of blocking a thread on each disk read or network call, an asynchronous call returns immediately; when the I/O eventually completes, the suspended continuation is resumed.
Why the other choices are not the main goal:
- Multithreading (option 1): async is a mechanism that is frequently implemented on a single thread (an event loop). It deliberately avoids the overhead of spawning many threads, so providing multithreading is not its aim.
- Concurrency in general (option 2): async does enable concurrency, but concurrency is the broad umbrella concept; the specific reason asynchronous constructs exist is to hide I/O latency.
- Effective parallelization (option 3): true parallelism needs several cores/threads executing simultaneously. Async by itself runs on one thread and provides no genuine parallelism.
Hence the essential objective is I/O overlap — performing other work during the I/O wait so the CPU is never idle. This matches the official key (option 4).
Exam trick: async parallel multithreaded. The word "asynchronous" points at non-blocking I/O: overlap the wait and keep a single thread productive.