Fork join_any and join

@(negedge a) begin
fork 
    begin //1
         fork
             begin
             wait(!b); //Consider this wont happen
             $display("b is low");
             end
             begin
             #5ns;    //Consider timeout happens  
             $display("b timeout"); 
             end
         join_any
         disable_fork;
    end
    begin //2
         fork
             begin
             wait(!c); //Consider this wont happen
             $display("c is low");
             end
             begin
             #10ns; //Consider timeout happens
             $display("c timeout");
             end
         join_any
         disable_fork;
     end
     begin //3
         fork
             begin
             wait(!d); //Consider this wont happen
             $display("d is low");
             end
             begin
             #5ns; //Consider timeout happens
             $display("d timeout"); 
             end
         join_any
         disable_fork;
     end
join //If I change this to join_any, how does it make a difference? 
end

In reply to abhi9891:

It makes a difference to the statement that executes immediately after this code fragment. It starts at 10ns with a join, and 5ns with join_any.

In reply to dave_59:

I was seeing a problem with fork join. Only statements b timeout and d timeout were executed and not c timeout (one with 10ns). Consider that there are no more statements after this code fragment.

I was thinking, if there was any specific reason. Does the disable fork, disable the main fork join as well and come out, hence not displaying the c(10ns) timeout?

I have then tried with fork join_any and all timeout are printing.

Considering no more code fragments after this, join and join_any should give the same results in this case.

In reply to abhi9891:

In reply to dave_59:
I was seeing a problem with fork join. Only statements b timeout and d timeout were executed and not c timeout (one with 10ns). Consider that there are no more statements after this code fragment.
I was thinking, if there was any specific reason. Does the disable fork, disable the main fork join as well and come out, hence not displaying the c(10ns) timeout?
I have then tried with fork join_any and all timeout are printing.
Considering no more code fragments after this, join and join_any should give the same results in this case.

Tested your code one EDA, no problem: Edit code - EDA Playground
It might simply that your program has ended before c timeouts.
-An

In reply to AnPham:

Thank you…:)