Skip to content

proposal: add thread check for most of the not thread-safe methodsΒ #590

@smartcmd

Description

@smartcmd

Problem

Since Allay is designed to be multi-thread between different worlds, it may be normal for plugin developers who are lack for multi-thread programming knowledges access not thread-safe methods in wrong threads unexpectedly. We need a mechanism to ensure plugin developers calling these methods correctly (in right thread), and throw exception when the caller is not in correct thread.

Solution

This proposal proposes an idea. To be detailed, we put check to these methods, and when they are called, the checker will check if the caller is in correct thread. This solution is similar to what Spigot/Paper did.

However, adding these checks may result in performance reduction. Maybe we can find a better solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalSome important decisions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions