Thread manipulation with fork join

Hi,

I have two threads which should be cross-talk each other, but each thread has different working period.
When I put those two in single fork as below, as assumed new “seq_ready” thread can not be started before “incrx_seq” is finished.


repeat(10) begin
               fork
                     seq_ready.start(env_h.slv_agnt.slv_seqr);
                     incrx_seq.start(env_h.mst_agnt.mseqr_h);
               join
           end

The log says below.

10: seq_ready Start <<<
10: incrx_seq Start <<<
10: seq_ready.ready.size: 7 <<< // OK
150: seq_ready Done <<<
150: seq_ready Start <<< // “seq_ready” invoked, but no proceeding
330: incrx_seq Done <<<
330: seq_ready.ready.size: 12 <<< // THIS SHOULD BE STARTED AT @150

What I want is “seq_ready” should be restarted as it finished regardless incrx_seq status.
How can I resolve this problem?

In reply to uvmbee:

Update…
It looks very strange…
The task in slv_seqr has


forever begin
                        $display (">>> %05t: Slave Seq begin <<<", $time);
                        seq_item_port.get_next_item(req);
                        $display (">>> %05t: Slave get_next_item <<<", $time);
                        fork
                                begin: drv
                                        drive();
                                        disable rst;
                                end
                                begin: rst
                                        reset_();
                                        disable drv;
                                end
                        join
                        seq_item_port.item_done(req);
                        $display (">>> %05t: Slave Seq Done <<<", $time);
                end

The log was


>>>   150: Slave Seq begin <<<
>>>   330: incrx_seq Done <<<
>>>   330: Slave get_next_item <<<  // Why "get_next_item" elapse time even after the task was started?

In reply to uvmbee:

I don’t see how your are getting this output with the code you have shown. You may want to try source level debugging if that is available to you. Also, it’s possible you meant to write

               fork
                     repeat(10) seq_ready.start(env_h.slv_agnt.slv_seqr);
                     repeat(10) incrx_seq.start(env_h.mst_agnt.mseqr_h);
               join