Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
7d975de1
Commit
7d975de1
authored
Jun 01, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed message_counter from tp
parent
5833c1de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
include/spdlog/details/thread_pool.h
include/spdlog/details/thread_pool.h
+2
-10
No files found.
include/spdlog/details/thread_pool.h
View file @
7d975de1
...
@@ -87,9 +87,8 @@ public:
...
@@ -87,9 +87,8 @@ public:
using
q_type
=
details
::
mpmc_blocking_queue
<
item_type
>
;
using
q_type
=
details
::
mpmc_blocking_queue
<
item_type
>
;
using
clock_type
=
std
::
chrono
::
steady_clock
;
using
clock_type
=
std
::
chrono
::
steady_clock
;
thread_pool
(
size_t
q_size_bytes
,
size_t
threads_n
)
thread_pool
(
size_t
q_max_items
,
size_t
threads_n
)
:
msg_counter_
(
0
)
:
q_
(
q_max_items
)
,
q_
(
q_size_bytes
)
{
{
// std::cout << "thread_pool() q_size_bytes: " << q_size_bytes << "\tthreads_n: " << threads_n << std::endl;
// std::cout << "thread_pool() q_size_bytes: " << q_size_bytes << "\tthreads_n: " << threads_n << std::endl;
if
(
threads_n
==
0
||
threads_n
>
1000
)
if
(
threads_n
==
0
||
threads_n
>
1000
)
...
@@ -134,13 +133,7 @@ public:
...
@@ -134,13 +133,7 @@ public:
post_async_msg
(
async_msg
(
std
::
move
(
worker_ptr
),
async_msg_type
::
flush
),
overflow_policy
);
post_async_msg
(
async_msg
(
std
::
move
(
worker_ptr
),
async_msg_type
::
flush
),
overflow_policy
);
}
}
size_t
msg_counter
()
{
return
msg_counter_
.
load
(
std
::
memory_order_relaxed
);
}
private:
private:
std
::
atomic
<
size_t
>
msg_counter_
;
// total # of messages processed in this pool
q_type
q_
;
q_type
q_
;
std
::
vector
<
std
::
thread
>
threads_
;
std
::
vector
<
std
::
thread
>
threads_
;
...
@@ -191,7 +184,6 @@ private:
...
@@ -191,7 +184,6 @@ private:
log_msg
msg
;
log_msg
msg
;
incoming_async_msg
.
to_log_msg
(
std
::
move
(
msg
));
incoming_async_msg
.
to_log_msg
(
std
::
move
(
msg
));
incoming_async_msg
.
worker_ptr
->
_backend_log
(
msg
);
incoming_async_msg
.
worker_ptr
->
_backend_log
(
msg
);
msg_counter_
.
fetch_add
(
1
,
std
::
memory_order_relaxed
);
return
true
;
return
true
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment