Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
6f3275e5
Commit
6f3275e5
authored
6 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_pjsip.c: Make taskprocessor scheduling algorithm pick the shortest queue"
parents
a3fc97aa
5f3f7077
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_pjsip.c
+11
-16
11 additions, 16 deletions
res/res_pjsip.c
with
11 additions
and
16 deletions
res/res_pjsip.c
+
11
−
16
View file @
6f3275e5
...
...
@@ -2803,9 +2803,6 @@
/*! Number of serializers in pool if one not supplied. */
#define SERIALIZER_POOL_SIZE 8
/*! Next serializer pool index to use. */
static
int
serializer_pool_pos
;
/*! Pool of serializers to use if not supplied. */
static
struct
ast_taskprocessor
*
serializer_pool
[
SERIALIZER_POOL_SIZE
];
...
...
@@ -4634,22 +4631,20 @@ static int serializer_pool_setup(void)
static
struct
ast_taskprocessor
*
serializer_pool_pick
(
void
)
{
struct
ast_taskprocessor
*
serializer
;
int
idx
;
int
pos
=
0
;
unsigned
int
pos
;
if
(
!
serializer_pool
[
0
])
{
return
NULL
;
}
/*
* Pick a serializer to use from the pool.
*
* Note: We don't care about any reentrancy behavior
* when incrementing serializer_pool_pos. If it gets
* incorrectly incremented it doesn't matter.
*/
pos
=
serializer_pool_pos
++
;
pos
%=
SERIALIZER_POOL_SIZE
;
serializer
=
serializer_pool
[
pos
];
for
(
idx
=
1
;
idx
<
SERIALIZER_POOL_SIZE
;
++
idx
)
{
if
(
ast_taskprocessor_size
(
serializer_pool
[
idx
])
<
ast_taskprocessor_size
(
serializer_pool
[
pos
]))
{
pos
=
idx
;
}
}
return
serializer
;
return
serializer
_pool
[
pos
]
;
}
int
ast_sip_push_task
(
struct
ast_taskprocessor
*
serializer
,
int
(
*
sip_task
)(
void
*
),
void
*
task_data
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment