Process class - usage of suspend and resume functions

Hi,

Can anyone explain as how to use the suspend() and resume() functions of the process class in SystemVerilog with some example. I searched the web but I couldn’t get practical example which could help in understanding the usage of these functions.

I’ll be looking forward to your humble response.

Thank you,

Regards,
Muneeb Ulla Shariff

In reply to muneebullashariff:

I have never seen these functions in use in SystemVerilog. These routines are certainly used in multi-threaded software applications. But they have little use in hardware applications which use other methods of synchronization, like events and signals. There were probably added for completeness.

In reply to dave_59:

In reply to muneebullashariff:
I have never seen these functions in use in SystemVerilog. These routines are certainly used in multi-threaded software applications. But they have little use in hardware applications which use other methods of synchronization, like events and signals. There were probably added for completeness.

Hi Dave,

Many thanks for your reply.

I have another question:

What exactly do you mean by “fork-join cannot be used for generating dynamic processes but fork-any/none can be used to generate dynamic process”. Can you please explain this.

Thank you,

Regards,
Muneeb Ulla Shariff

In reply to muneebullashariff:

fork/join suspends the parent thread and spawns a static number of child threads determined by the number of statements inside the fork parsed at compile time. There is no way to create an arbitrary number of threads based on some run time expression.