How to pass time in SystemVerilog while waiting for data on a socket in DPI

In reply to jwhatley:

The SystemVerilog DPI has nothing built-in for OS thread-safe event triggering. Even if it did, it’s unlikely to be any more efficient than the polling method you came up with, just a little more convenient.

If you are already using C++, you may want to consider using SystemC’s async_request_update() method, but that might be overkill for your needs.