Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Control a background process lifecycle

Hardware interview practice

Control a background process lifecycle

MediumTemporal ChecksSystemVerilog

Start a polling task in the background and later stop exactly that task through a stored process handle.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Reviewed example

Work through one case

Input
call start(), start(), stop(), stop()
Expected output
one worker starts; second start is ignored; first stop kills that owned worker; final stop is a safe no-op

Publishing the stored process handle before start returns removes the initialization race and targets only the intended background task.

What to cover

Requirements

  1. Starting the worker must not leave the caller racing an uninitialized handle.
  2. Ignore a second start while the worker is already active.
  3. Stopping must be safe when no worker is active.
asic.fyi · Learn silicon end to end.info@asic.fyi