Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
b4c6dda0
Commit
b4c6dda0
authored
9 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master' into 1.6
Conflicts: src/box/iproto.cc
parents
dc6f56fb
9f92caf4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/box/iproto.cc
+3
-2
3 additions, 2 deletions
src/box/iproto.cc
src/cbus.cc
+7
-2
7 additions, 2 deletions
src/cbus.cc
src/cbus.h
+6
-1
6 additions, 1 deletion
src/cbus.h
with
16 additions
and
5 deletions
src/box/iproto.cc
+
3
−
2
View file @
b4c6dda0
...
@@ -116,7 +116,7 @@ struct IprotoMsgGuard {
...
@@ -116,7 +116,7 @@ struct IprotoMsgGuard {
{
struct
iproto_msg
*
tmp
=
msg
;
msg
=
NULL
;
return
tmp
;
}
{
struct
iproto_msg
*
tmp
=
msg
;
msg
=
NULL
;
return
tmp
;
}
};
};
enum
{
IPROTO_FIBER_POOL_SIZE
=
1024
};
enum
{
IPROTO_FIBER_POOL_SIZE
=
1024
,
IPROTO_FIBER_POOL_IDLE_TIMEOUT
=
3
};
/* }}} */
/* }}} */
...
@@ -838,7 +838,8 @@ iproto_init()
...
@@ -838,7 +838,8 @@ iproto_init()
static
struct
cpipe_fiber_pool
fiber_pool
;
static
struct
cpipe_fiber_pool
fiber_pool
;
cpipe_fiber_pool_create
(
&
fiber_pool
,
"iproto"
,
&
tx_pipe
,
cpipe_fiber_pool_create
(
&
fiber_pool
,
"iproto"
,
&
tx_pipe
,
IPROTO_FIBER_POOL_SIZE
);
IPROTO_FIBER_POOL_SIZE
,
IPROTO_FIBER_POOL_IDLE_TIMEOUT
);
static
struct
cord
net_cord
;
static
struct
cord
net_cord
;
if
(
cord_costart
(
&
net_cord
,
"iproto"
,
net_cord_f
,
NULL
))
if
(
cord_costart
(
&
net_cord
,
"iproto"
,
net_cord_f
,
NULL
))
...
...
This diff is collapsed.
Click to expand it.
src/cbus.cc
+
7
−
2
View file @
b4c6dda0
...
@@ -257,9 +257,13 @@ cpipe_fiber_pool_f(va_list ap)
...
@@ -257,9 +257,13 @@ cpipe_fiber_pool_f(va_list ap)
rlist_add_entry
(
&
pool
->
fiber_cache
,
fiber
(),
state
);
rlist_add_entry
(
&
pool
->
fiber_cache
,
fiber
(),
state
);
pool
->
size
--
;
pool
->
size
--
;
pool
->
cache_size
++
;
pool
->
cache_size
++
;
fiber_yield
(
);
bool
timed_out
=
fiber_yield_timeout
(
pool
->
idle_timeout
);
pool
->
cache_size
--
;
pool
->
cache_size
--
;
pool
->
size
++
;
pool
->
size
++
;
if
(
timed_out
)
{
/** Nothing to do for quite a while */
return
;
}
goto
restart
;
goto
restart
;
}
}
}
}
...
@@ -296,7 +300,7 @@ cpipe_fiber_pool_cb(ev_loop * /* loop */, struct ev_async *watcher,
...
@@ -296,7 +300,7 @@ cpipe_fiber_pool_cb(ev_loop * /* loop */, struct ev_async *watcher,
void
void
cpipe_fiber_pool_create
(
struct
cpipe_fiber_pool
*
pool
,
cpipe_fiber_pool_create
(
struct
cpipe_fiber_pool
*
pool
,
const
char
*
name
,
struct
cpipe
*
pipe
,
const
char
*
name
,
struct
cpipe
*
pipe
,
int
max_pool_size
)
int
max_pool_size
,
float
idle_timeout
)
{
{
rlist_create
(
&
pool
->
fiber_cache
);
rlist_create
(
&
pool
->
fiber_cache
);
pool
->
name
=
name
;
pool
->
name
=
name
;
...
@@ -304,5 +308,6 @@ cpipe_fiber_pool_create(struct cpipe_fiber_pool *pool,
...
@@ -304,5 +308,6 @@ cpipe_fiber_pool_create(struct cpipe_fiber_pool *pool,
pool
->
size
=
0
;
pool
->
size
=
0
;
pool
->
cache_size
=
0
;
pool
->
cache_size
=
0
;
pool
->
max_size
=
max_pool_size
;
pool
->
max_size
=
max_pool_size
;
pool
->
idle_timeout
=
idle_timeout
;
cpipe_set_fetch_cb
(
pipe
,
cpipe_fiber_pool_cb
,
pool
);
cpipe_set_fetch_cb
(
pipe
,
cpipe_fiber_pool_cb
,
pool
);
}
}
This diff is collapsed.
Click to expand it.
src/cbus.h
+
6
−
1
View file @
b4c6dda0
...
@@ -457,6 +457,11 @@ struct cpipe_fiber_pool {
...
@@ -457,6 +457,11 @@ struct cpipe_fiber_pool {
int
cache_size
;
int
cache_size
;
/** The limit on the number of fibers working on tasks. */
/** The limit on the number of fibers working on tasks. */
int
max_size
;
int
max_size
;
/**
* Fibers in leave the pool if they have nothing to do
* for longer than this.
*/
float
idle_timeout
;
struct
cpipe
*
pipe
;
struct
cpipe
*
pipe
;
};
};
...
@@ -467,6 +472,6 @@ struct cpipe_fiber_pool {
...
@@ -467,6 +472,6 @@ struct cpipe_fiber_pool {
void
void
cpipe_fiber_pool_create
(
struct
cpipe_fiber_pool
*
pool
,
cpipe_fiber_pool_create
(
struct
cpipe_fiber_pool
*
pool
,
const
char
*
name
,
struct
cpipe
*
pipe
,
const
char
*
name
,
struct
cpipe
*
pipe
,
int
max_pool_size
);
int
max_pool_size
,
float
idle_timeout
);
#endif
/* TARANTOOL_CBUS_H_INCLUDED */
#endif
/* TARANTOOL_CBUS_H_INCLUDED */
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