Questions on Lock() a sequencer

In reply to vbabusr:

It might help to show some code for the scenarios you have trouble comprehending. I’m assuming each sequence will be sending in several sequence items. Also assume that S1,S2,S3 are identical instances of the following running in parallel

task my_sequence::body();
    repeat (20) begin
          req = my_sequence_item::type_id::create(...);
          start_item(req);
          finish_item(req);
    end
    lock()
   repeat (20) begin
          req = my_sequence_item::type_id::create(...);
          start_item(req);
          finish_item(req);
    end
    unlcok();
endtask

The first 60 sequences will be FIFO arbitrated with 20 sequence items from each sequence. (S1.1 ->S2.1-> S3.1 → S1.2 ->S2.2-> S3.2 ->…-> S3.20) All three sequences will issue a lock after finishing from their 20th sequence_item. When S1’s 21st sequence_item get granted, the lock becomes effective and the next 20 sequence items will come from S1. (S1.21 ->S1.22-> S1.23 → S1.24 ->…S1.40). Followed by 20 from S2 and then S3.

The only difference if grab() was used instead lock() is that S2.20 and S3.20 have not been granted and S1.21 would get an overriding priority to be started.