Skip to content

[Idea] Changing the use of synchronized in the getBinder method of DefaultBinderFactory class for virtual threads #3004

@ferblaca

Description

@ferblaca

The getBinder method in the DefaultBinderFactory class is marked as synchronized. However, the use of synchronized can be detrimental to performance when using Virtual Threads in Java, as it can introduce deadlocks that negatively affect concurrency and performance.

The getBinder method can be invoked multiple times during the life cycle of the application:

  • During initialisation: When the application starts and configures the different message channels.
  • At runtime: Every time a new binder is needed for a specific message channel.

So it would be nice to replace synchronized with a more suitable concurrency mechanism, like ReentrantLock.

If you think it's right, we can contribute it.

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