Skip to content

Use limited number of threads #120

@koca2000

Description

@koca2000

NoteBlockAPI 1.x uses one platform thread for each SongPlayer even when the playback has not started yet. It is not very resource effective so a different solution should be used.

@Elecast2 proposed a solution with a single-threaded ticker in PR #119. However, this solution use fixed 10ms delay which in some cases may not be precise enough and in other situations it does unnecessary work. Also it serialize SongPlayers into a queue and so e.g. an event in one of the SongPlayers may delay playback of the others.

I like the idea of the SongTicker or custom ExecutorService, but it has to be done in a way that one SongPlayer doesn't affect the others. Something like a group of worker threads and a PriorityQueue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions