# Confusion in fork join ... disable fork

**URL:** <https://verificationacademy.com/forums/t/confusion-in-fork-join-disable-fork/28662>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [June 26, 2013, 6:12pm UTC](https://verificationacademy.com/forums/t/confusion-in-fork-join-disable-fork/28662 "2013-06-26T18:12:25Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![sbollemp](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@sbollemp](https://verificationacademy.com/forums/u/sbollemp)\
**Post date:** [December 7, 2016, 12:04pm UTC](https://verificationacademy.com/forums/t/confusion-in-fork-join-disable-fork/28662/22 "2016-12-07T12:04:39Z")

</div>

Hi Dave,

Can you please explain the below code.

```verilog
module top_fork();
  

  task task1();
    forever begin
      #5;
      $display("in task1");
    end
  endtask
  
  task task2();
    forever begin
      #6;
      $display("in task2");
    end
  endtask
  
  task task3();
    fork : task3_0
    forever begin
      #7;
   // disable fork task3_0 ;
      $display("disable fork before");
   // disable task3_0 ;
      disable fork ;
        $display("disable fork after");
      $display("in task3");
    end
    join
  endtask
  
  task task4();
    forever begin
      #8;
      $display("in task4");
    end
  endtask
  
  initial begin
   fork : name
      task1();
      task2();
      task3();
      task4();
    join
  end
  
  initial begin
    #60;
    $finish;
  end
  
endmodule

```

As per my understanding after disabling the fork in task3 it should not print the messages from task3. But it is not the scenario what i was getting in simulation.

Thanks & Regards,  
Shriramvaraprasad B.

---

_[View the full topic](https://verificationacademy.com/forums/t/confusion-in-fork-join-disable-fork/28662)._
