A method and system for passing messages between threads is provided, in
which a sending thread communicates with a receiving thread by passing a
reference to the message to a message queue associated with the receiving
thread. The reference may be passed without explicitly invoking the
inter-process or inter-thread message passing services of the computer's
operating system. The sending thread may also have a message queue
associated with it, and the sending thread's queue may include a
reference to the receiving thread's queue. The sending thread can use
this reference to pass messages to the receiving thread's queue.