I am putting a data into the mailbox using put method, and using peek method i want to retrieve data from the mailbox, peek method copy the data and it won’t delete the data from the mailbox. can we access only 1st element in the mailbox or can we access 2 element through peek method.
ex:
mailbox mbx=new(4);
//generator
repeat(4)
begin
data=$urandom; //suppose random values are 10,20,30,40
mbx.put(data);
end
//driver
forever
begin
mbx.peek(data); //can I copy all values(10,20,30,40)from mailbox using peek method.
#1;
end