In reply to j_vin:
Hand shaking between hardware and c code is possible using DPI-C.
Suppose you are launching a task from systemverilog which is a C subroutine.
Now from that C subroutine if you are calling some exported task from system verilog then again control will go back to system verilog and hardware will be running until there is a next call for again some C subroutine.
In that way both processes will be running alternatively.