How to implement fork join_none block using fork join_any and fork join_any using fork join_none?

is it possible

It is certainly possible to implement fork/join_none with join_any by inserting a null statement.

module top;
   initial begin
      fork
	 #10 $display("#10");
	 #20 $display("#20");
	 begin end
      join_any
      $display("done fork");
   end
endmodule



And fork/join_any can be implemented with fork/join_none by adding an event.

module top;
   event any;
   initial begin
      fork
	 begin #10 $display("#10"); ->any; end
	 begin #20 $display("#20"); ->any; end
      join_none
      @any;
      $display("done fork");
   end
endmodule

Is this question just to help your understand these fork constructs, or is there some other situation you are trying to avoid by replacing one construct with another? I would need to know more about that situation to help you further. There are subtle differences other constructs like disable fork and wait fork.

In reply to dave_59:

hi dave,

    thanks for the answer . And can u explain us more about Wait fork.

In reply to krunal_shukla:

The issue with wait fork statement is that it waits on all thread children of the thread containing the wait fork statement. You have to be very carefully aware of the child threads you are waiting on as there could be many fork statements in the current thread. The fork/join_any only waits on those threads inside the scope of the fork/join_any.

It would really help to explain the issue behind what is generating these doubts.