1.

What Is The Difference Between Mailbox And Queue?

Answer»

A queue is a variable-size, ordered collection of homogeneous elements. A Queue is analogous to one dimensional unpacked array that grows and shrinks automatically. Queues can be used to model a LAST in, first out buffer or first in, first out buffer.

// Other DATA type as REFERENCE
// INT q[]; dynamic array
// int q[5]; fixed array
// int q[string]; associate array 
// include <
// List#(integer) List1; //

int q[$] = { 2, 4, 8 };
int p[$];
int E, pos;
e = q[0]; // read the first (leftmost) item
e = q[$]; // read the last (rightmost) item
q[0] = e; // write the first item
p = q; // read and write entire queue (copy)

A mailbox is a communication mechanism that allows messages to be exchanged between processes. Data can be sent to a mailbox by one process and retrieved by another.

A queue is a variable-size, ordered collection of homogeneous elements. A Queue is analogous to one dimensional unpacked array that grows and shrinks automatically. Queues can be used to model a last in, first out buffer or first in, first out buffer.

// Other data type as reference
// int q[]; dynamic array
// int q[5]; fixed array
// int q[string]; associate array 
// include <
// List#(integer) List1; //

int q[$] = { 2, 4, 8 };
int p[$];
int e, pos;
e = q[0]; // read the first (leftmost) item
e = q[$]; // read the last (rightmost) item
q[0] = e; // write the first item
p = q; // read and write entire queue (copy)

A mailbox is a communication mechanism that allows messages to be exchanged between processes. Data can be sent to a mailbox by one process and retrieved by another.



Discussion

No Comment Found