Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs in dispatch queue creation #204

Closed
jrmaxdev opened this issue Jun 19, 2017 · 0 comments
Closed

bugs in dispatch queue creation #204

jrmaxdev opened this issue Jun 19, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@jrmaxdev
Copy link

Creating a dispatch queue with dispatch_queue_create requires an attr param.
This attribute can be created with dispatch_queue_attr_make_with_qos_class.
This function takes a relative_priority as third parameter.

dispatch_queue_attr_make_with_qos_class is used in three MIKMIDI source files:

MIKMIDIClock.m
MIKMIDISequencer.m
MIKMIDISynthesizer.m

In all cases DISPATCH_QUEUE_PRIORITY_HIGH is assigned to it.

It is defined to be 2 (<queue.h>)
#define DISPATCH_QUEUE_PRIORITY_HIGH 2

This assignment leads to a NULL result and a standard serial queue will be created.

From the Dispatch framework documentation:

relative_priority
A negative offset from the maximum supported scheduler priority for the given quality-of-service class. This value must be less than 0 and greater than or equal to QOS_MIN_RELATIVE_PRIORITY, or else this function returns NULL.

To assign a quality of service class to the queue and achieve maximum priority in relation to it the value should be 0.

attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INTERACTIVE, 0);

or

attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0);

@armadsen armadsen self-assigned this Aug 22, 2017
@armadsen armadsen added the bug label Aug 22, 2017
@armadsen armadsen added this to the 1.6.2 milestone Aug 22, 2017
armadsen added a commit that referenced this issue Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants