Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KOS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
Martin Karsten
KOS
Commits
ba389032
Commit
ba389032
authored
6 years ago
by
Martin Karsten
Browse files
Options
Downloads
Patches
Plain Diff
- webserver acceptor fibres not in background
- add connection counter to webserver
parent
c4381bc3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libfibre/webserver.cpp
+8
-5
8 additions, 5 deletions
src/libfibre/webserver.cpp
src/testoptions.h
+1
-1
1 addition, 1 deletion
src/testoptions.h
with
9 additions
and
6 deletions
src/libfibre/webserver.cpp
+
8
−
5
View file @
ba389032
...
...
@@ -121,13 +121,15 @@ static void usage(const char* prog) {
}
// fibre counting
static
volatile
size_t
connections
=
0
;
static
volatile
size_t
connectionFibres
=
0
;
static
void
exitHandler
(
int
sig
)
{
if
(
sig
==
SIGINT
)
cout
<<
endl
;
cout
<<
"threads: "
<<
threadCount
<<
" cluster size: "
<<
clusterSize
<<
" listeners: "
<<
listenerCount
<<
" event scopes: "
<<
scopeCount
;
if
(
affinityFlag
)
cout
<<
" affinity"
;
cout
<<
endl
<<
"fibres: "
<<
connectionFibres
<<
endl
;
cout
<<
endl
<<
"connections: "
<<
connections
<<
endl
;
cout
<<
"fibres: "
<<
connectionFibres
<<
endl
;
exit
(
0
);
}
...
...
@@ -326,6 +328,7 @@ static int create_socket(bool singleAccept = false) {
static
void
handler_loop
(
void
*
arg
)
{
for
(;;)
{
__atomic_add_fetch
(
&
connections
,
1
,
__ATOMIC_RELAXED
);
while
(
connHandler
(
arg
));
arg
=
CurrGarage
().
park
();
}
...
...
@@ -441,9 +444,9 @@ static void scopemain() {
// set poller thread affinity to group of cores
CPU_SET
(
cpu
,
&
clustercpus
);
if
(((
t
%
clusterSize
)
==
clusterSize
-
1
)
||
(
t
==
threadCount
-
1
))
{
// end of cluster or end of threads
// cout << "cluster "<< cidx << " affinity";
for
(
int
j
=
0
;
j
<
CPU_SETSIZE
;
j
++
)
if
(
CPU_ISSET
(
j
,
&
clustercpus
))
cout
<<
' '
<<
j
;
cout
<<
endl
;
// cout << "cluster "
<< cidx << " affinity
:
";
//
for (int j = 0; j < CPU_SETSIZE; j++) if (CPU_ISSET(j, &clustercpus)) cout << ' ' << j;
//
cout << endl;
SYSCALL
(
pthread_setaffinity_np
(
cluster
[
cidx
]
->
getPoller
().
getSysID
(),
sizeof
(
clustercpus
),
&
clustercpus
));
CPU_ZERO
(
&
clustercpus
);
cidx
+=
1
;
...
...
@@ -473,7 +476,7 @@ static void scopemain() {
for
(
unsigned
int
c
=
0
;
c
<
clusterCount
;
c
+=
1
)
{
if
(
listenerCount
)
{
for
(
unsigned
int
i
=
0
;
i
<
listenerCount
;
i
+=
1
)
{
Fibre
*
f
=
new
Fibre
(
acceptor
,
(
void
*
)
servFD
,
true
);
Fibre
*
f
=
new
Fibre
(
acceptor
,
(
void
*
)
servFD
);
#if defined __LIBFIBRE__
f
->
setPriority
(
topPriority
);
#endif
...
...
This diff is collapsed.
Click to expand it.
src/testoptions.h
+
1
−
1
View file @
ba389032
...
...
@@ -30,7 +30,7 @@
//#define TESTING_POLLER_FIBRES 1 // vs. per-cluster poller pthread
//#define TESTING_POLLER_IDLEWAIT 1 // vs. wake up poller thread anytime
//#define TESTING_POLLER_IDLETIMEDWAIT 1000
0
// vs. wait indefinitely for idle (usecs)
//#define TESTING_POLLER_IDLETIMEDWAIT 1000 // vs. wait indefinitely for idle (usecs)
#define TESTING_BULK_RESUME 1 // vs. individual resume
#define TESTING_LAZY_FD_REGISTRATION 1 // vs. eager registration after fd creation
...
...
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