Skip to content

Mailbox Behavior and Documentation Inconsistent #698

@kg6y-ucd

Description

@kg6y-ucd

The documentation states that the Mailbox is a first-in-first-out queue, but in reality, it is last-in-first-out.

CL-USER> (lisp-implementation-version)
"1.8.0"
"Java_HotSpot(TM)_64-Bit_Server_VM-Oracle_Corporation-1.8.0_181-b13"
"amd64-Windows_10-10.0"
CL-USER> (setf *mailbox* (threads:make-mailbox))
#S(EXTENSIONS:MAILBOX :QUEUE NIL)
CL-USER> (documentation (type-of *mailbox*) 'type)
"A first-in-first out queue of messages"
CL-USER> (threads:mailbox-send *mailbox* 100)
NIL
CL-USER> *mailbox*
#S(EXTENSIONS:MAILBOX :QUEUE (100))
CL-USER> (threads:mailbox-send *mailbox* 200)
NIL
CL-USER> *mailbox*
#S(EXTENSIONS:MAILBOX :QUEUE (200 100))
CL-USER> (threads:mailbox-read *mailbox*)
200
CL-USER> *mailbox*
#S(EXTENSIONS:MAILBOX :QUEUE (100))
CL-USER> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions