A program control apparatus ensuring real time response by ensuring execution
of
a process exclusively without locking the system includes a unit responsive to
an application program interface call from a thread which interface requesting
start of detection of presence/absence of a context switching, for setting a flag
indicating presence/absence of a context switching to a state corresponding to
absence of a context switching, a unit for setting, after said flag is set to the
state corresponding to absence of a context switching and a scheduler switches
context, the flag to a state corresponding to presence of a context switching,
and a unit responsive to an application program interface call from the thread,
which interface requesting termination of detection of presence/absence of a context
switching, returning a value corresponding to the state of the flag to the thread.