Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
d4e26311
Unverified
Commit
d4e26311
authored
Sep 07, 2021
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4586 Added Thread Pool
parent
4066708d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
15 deletions
+11
-15
VERSION
VERSION
+1
-1
Agent.cpp
zmq_src/Agent.cpp
+5
-8
Agent.h
zmq_src/Agent.h
+2
-4
ZMQServer.cpp
zmq_src/ZMQServer.cpp
+3
-2
No files found.
VERSION
View file @
d4e26311
1.78.0
\ No newline at end of file
1.83.0
\ No newline at end of file
zmq_src/Agent.cpp
View file @
d4e26311
...
...
@@ -24,17 +24,14 @@
#include "Agent.h"
void
Agent
::
notifyAllConditionVariables
()
{
messageCond
.
notify_all
();
queueCond
.
notify_all
();
}
Agent
::
Agent
()
:
startedWorkers
(
false
)
{};
void
Agent
::
waitOnGlobalStartBarrier
()
{
unique_lock
<
mutex
>
mlock
(
queue
Mutex
);
unique_lock
<
mutex
>
lock
(
start
Mutex
);
while
(
!
startedWorkers
)
{
queueCond
.
wait
(
mlock
);
// wait until notified to start running
startCond
.
wait
(
lock
);
}
}
...
...
@@ -49,7 +46,7 @@ void Agent::releaseWorkers() {
return
;
}
lock_guard
<
mutex
>
lock
(
queue
Mutex
);
lock_guard
<
mutex
>
lock
(
start
Mutex
);
queue
Cond
.
notify_all
();
start
Cond
.
notify_all
();
}
zmq_src/Agent.h
View file @
d4e26311
...
...
@@ -38,8 +38,8 @@ protected:
mutex
messageMutex
;
condition_variable
messageCond
;
condition_variable
queue
Cond
;
mutex
queue
Mutex
;
condition_variable
start
Cond
;
mutex
start
Mutex
;
recursive_mutex
m
;
...
...
@@ -48,8 +48,6 @@ public:
Agent
();
void
notifyAllConditionVariables
();
virtual
~
Agent
();
void
releaseWorkers
();
...
...
zmq_src/ZMQServer.cpp
View file @
d4e26311
...
...
@@ -260,11 +260,12 @@ void ZMQServer::doOneServerLoop() {
}
}
void
ZMQServer
::
workerThreadMessageProcessLoop
(
ZMQServer
*
_agent
)
{
CHECK_STATE
(
_agent
);
_agent
->
waitOnGlobalStartBarrier
();
// do work forever until told to exit
while
(
!
isExitRequested
)
{
sleep
(
100
);
sleep
(
1000
);
cerr
<<
"WORKER LOOP"
<<
endl
;
}
}
\ No newline at end of file
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