adplus-dvertising
frame-decoration

Question

What happens when a program calls the GetMessageWin32 API and there are no messages in the queue?

a.

The program stalls and does not return

b.

The kernel saves the entire processor state and switches to run another thread

c.

The kernel interrupts the thread and runs another one

d.

The program continues running without any input

Posted under Reverse Engineering

Answer: (b).The kernel saves the entire processor state and switches to run another thread Explanation:GetMessage just enters a waiting mode and doesn’t return until new user input becomes available...At this point the kernel saves the entire processor state and switches to run another thread.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What happens when a program calls the GetMessageWin32 API and there are no messages in the queue?

Similar Questions

Discover Related MCQs

Q. What does the kernel do when an application performs a slow I/O operation?

Q. What is preemptive scheduling?

Q. What is a thread's quantum?

Q. How does the operating system monitor how long a thread has been running?

Q. What happens when a thread's quantum is up?

Q. How does the kernel ensure that a thread has no idea that it was ever interrupted?

Q. What is the main challenge of synchronizing multiple threads in the same program?

Q. What do synchronization objects allow two or more threads to do?

Q. What is the purpose of putting blocked threads in a special wait state?

Q. Why must the scheduler be aware of synchronization objects?

Q. What are synchronization objects used for in multithreaded programming?

Q. What is an event in multithreaded programming?

Q. How does a mutex work in multithreaded programming?

Q. What is the difference between a mutex and a critical section in multithreaded programming?

Q. What is the purpose of semaphores in multithreaded programming?

Q. What is the first step taken by the system in an average process creation sequence?

Q. What is the responsibility of LdrpInitialize in the process initialization sequence?

Q. What is the responsibility of LdrpRunInitializeRoutines in the process initialization sequence?

Q. What is the responsibility of BaseProcessStart in the process initialization sequence?

Q. What is an API?