ArticleslgStudy

computer science

Asynchronous procedure call

Asynchronous procedure call is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Asynchronous procedure call rather than just read about it. In short: An asynchronous procedure call (APC) is a unit of work in a computer. Definition Procedure calls can be synchronous or asynchronous.

Key takeaways

  • Asynchronous procedure call belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Asynchronous procedure call to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Asynchronous procedure call from memory before moving on to harder problems.

Reference excerpt

An asynchronous procedure call (APC) is a unit of work in a computer.

Definition Procedure calls can be synchronous or asynchronous. Synchronous procedure calls are made on one thread in a series, with each call waiting for the prior call to complete. on some thread. APCs instead are made without waiting for prior calls to complete. For example, if some data are not ready (for example, a program waits for a user to reply), then stopping other activity on the thread is expensive, the thread has consumed memory and potentially other resources.

Structure An APC is typically formed as an object with a small amount of memory and this object is passed to a service which handles the wait interval, activating it when the appropriate event (e.g., user input) occurs. The life cycle of an APC consists of 2 stages: the passive stage, when it passively waits for input data, and active state, when that data is calculated in the same way as at the usual procedure call. A reusable asynchronous procedure is termed actor. In the actor model, two ports are used: one to receive input, and another (hidden) port to handle the input. In dataflow programming, many ports are used, passing to an execution service when all inputs are present.

Implementations In Windows, APC is a function that executes asynchronously in the context of a specific thread. APCs can be generated by the system (kernel-mode APCs) or by an application (user mode APCs). The operating system creates kernal-mode APCs, and an application creates user-model APCs. When an APC is queued to the thread, Windows issues the software interrupt, and the thread runs the function next time it is scheduled. Each thread has its own APC queue. An application queues a user-mode APC by calling QueueUserAPC and passing the address of the function to run. A regular user-mode APC runs only while that thread is in an alertable state. A thread enters an alertable state by calling SleepEx, SignalObjectAndWait, MsgWaitForMultipleObjectsEx, WaitForMultipleObjectsEx or WaitForSingleObjectEx. ReadFileEx, WriteFileEx, SetWaitableTimer, and SetWaitableTimerEx use an APC as the completion callback. A special user-mode APC runs even when the thread is not in an alertable state. A normal kernel APC runs in kernel mode at PASSIVE_LEVEL. A special kernel APC runs at APC_LEVEL and handles completion of an input or output request.

See also Signal

References

Worked examples

Example 1 — a first encounter with Asynchronous procedure call

Start with the simplest possible case. Write down what Asynchronous procedure call claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Asynchronous procedure call before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Asynchronous procedure call ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Asynchronous procedure call

In research
Asynchronous procedure call appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Asynchronous procedure call in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Asynchronous procedure call is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer programming, Computer programming stubs, Microsoft Windows stubs, so understanding it makes those chapters shorter.
In everyday life
Look for Asynchronous procedure call outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Asynchronous procedure call” →

How to study Asynchronous procedure call in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Asynchronous procedure call means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Asynchronous procedure call out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Asynchronous procedure call in simple terms?

An asynchronous procedure call (APC) is a unit of work in a computer. Definition Procedure calls can be synchronous or asynchronous.

Why does Asynchronous procedure call matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Asynchronous procedure call?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Asynchronous procedure call.

Tags

  • Computer programming
  • Computer programming stubs
  • Microsoft Windows stubs

Keep exploring