Skip to content

fix: Mailbox Behavior - #754

Open
iwami4438 wants to merge 1 commit into
armedbear:masterfrom
iwami4438:fix-Mailbox-Behavior
Open

fix: Mailbox Behavior#754
iwami4438 wants to merge 1 commit into
armedbear:masterfrom
iwami4438:fix-Mailbox-Behavior

Conversation

@iwami4438

Copy link
Copy Markdown
Quick check(used docker)
VM settings:
    Max. Heap Size (Estimated): 7.71G
    Using VM: OpenJDK 64-Bit Server VM

Armed Bear Common Lisp 1.9.3-dev
Java 25.0.3 Eclipse Adoptium
OpenJDK 64-Bit Server VM
Low-level initialization completed in 0.076 seconds.
Startup completed in 0.345 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (setf *mailbox* (threads:make-mailbox))
#S(MAILBOX :QUEUE NIL)
CL-USER(2): (documentation (type-of *mailbox*) 'type)
"A first-in-first out queue of messages"
CL-USER(3): (threads:mailbox-send *mailbox* 100)
NIL
CL-USER(4): *mailbox*
#S(MAILBOX :QUEUE (100))
CL-USER(5): (threads:mailbox-send *mailbox* 200)
NIL
CL-USER(6): *mailbox*
#S(MAILBOX :QUEUE (100 200))
CL-USER(7): (threads:mailbox-read *mailbox*)
100
CL-USER(8):  *mailbox*
#S(MAILBOX :QUEUE (200))

Fixed the implementation because it was using a stack instead of a queue.
@iwami4438

Copy link
Copy Markdown
Author

Since nconc traverses the list from the beginning, I believe this approach would be slow.
If we want to improve performance, I think we should open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mailbox Behavior and Documentation Inconsistent

1 participant