Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
f92de9b2
Commit
f92de9b2
authored
Sep 02, 2009
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug during terminal shutdown fixed
parent
702fdbb5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
17 deletions
+41
-17
local_lat.c
perf/c/local_lat.c
+9
-4
local_thr.c
perf/c/local_thr.c
+4
-1
remote_lat.c
perf/c/remote_lat.c
+10
-5
remote_thr.c
perf/c/remote_thr.c
+3
-0
local_thr.cpp
perf/cpp/local_thr.cpp
+1
-1
remote_lat.cpp
perf/cpp/remote_lat.cpp
+1
-1
session.cpp
src/session.cpp
+13
-5
No files found.
perf/c/local_lat.c
View file @
f92de9b2
...
@@ -52,19 +52,24 @@ int main (int argc, char *argv [])
...
@@ -52,19 +52,24 @@ int main (int argc, char *argv [])
rc
=
zmq_bind
(
s
,
bind_to
);
rc
=
zmq_bind
(
s
,
bind_to
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
rc
=
zmq_msg_init
(
&
msg
);
assert
(
rc
==
0
);
for
(
i
=
0
;
i
!=
roundtrip_count
;
i
++
)
{
for
(
i
=
0
;
i
!=
roundtrip_count
;
i
++
)
{
rc
=
zmq_msg_init
(
&
msg
);
assert
(
rc
==
0
);
rc
=
zmq_recv
(
s
,
&
msg
,
0
);
rc
=
zmq_recv
(
s
,
&
msg
,
0
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
assert
(
zmq_msg_size
(
&
msg
)
==
message_size
);
assert
(
zmq_msg_size
(
&
msg
)
==
message_size
);
rc
=
zmq_send
(
s
,
&
msg
,
0
);
rc
=
zmq_send
(
s
,
&
msg
,
0
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
rc
=
zmq_msg_close
(
&
msg
);
assert
(
rc
==
0
);
}
}
rc
=
zmq_msg_close
(
&
msg
);
assert
(
rc
==
0
);
sleep
(
1
);
sleep
(
1
);
rc
=
zmq_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
return
0
;
}
}
perf/c/local_thr.c
View file @
f92de9b2
...
@@ -90,7 +90,10 @@ int main (int argc, char *argv [])
...
@@ -90,7 +90,10 @@ int main (int argc, char *argv [])
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message count: %d
\n
"
,
(
int
)
message_count
);
printf
(
"message count: %d
\n
"
,
(
int
)
message_count
);
printf
(
"mean throughput: %d [msg/s]
\n
"
,
(
int
)
throughput
);
printf
(
"mean throughput: %d [msg/s]
\n
"
,
(
int
)
throughput
);
printf
(
"mean throughput: %3f [Mb/s]
\n
"
,
(
double
)
megabits
);
printf
(
"mean throughput: %.3f [Mb/s]
\n
"
,
(
double
)
megabits
);
rc
=
zmq_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
return
0
;
}
}
perf/c/remote_lat.c
View file @
f92de9b2
...
@@ -59,18 +59,20 @@ int main (int argc, char *argv [])
...
@@ -59,18 +59,20 @@ int main (int argc, char *argv [])
rc
=
gettimeofday
(
&
start
,
NULL
);
rc
=
gettimeofday
(
&
start
,
NULL
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
rc
=
zmq_msg_init_size
(
&
msg
,
message_size
);
assert
(
rc
==
0
);
for
(
i
=
0
;
i
!=
roundtrip_count
;
i
++
)
{
for
(
i
=
0
;
i
!=
roundtrip_count
;
i
++
)
{
rc
=
zmq_msg_init_size
(
&
msg
,
message_size
);
assert
(
rc
==
0
);
rc
=
zmq_send
(
s
,
&
msg
,
0
);
rc
=
zmq_send
(
s
,
&
msg
,
0
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
rc
=
zmq_recv
(
s
,
&
msg
,
0
);
rc
=
zmq_recv
(
s
,
&
msg
,
0
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
assert
(
zmq_msg_size
(
&
msg
)
==
message_size
);
assert
(
zmq_msg_size
(
&
msg
)
==
message_size
);
rc
=
zmq_msg_close
(
&
msg
);
assert
(
rc
==
0
);
}
}
rc
=
zmq_msg_close
(
&
msg
);
assert
(
rc
==
0
);
rc
=
gettimeofday
(
&
end
,
NULL
);
rc
=
gettimeofday
(
&
end
,
NULL
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
...
@@ -83,7 +85,10 @@ int main (int argc, char *argv [])
...
@@ -83,7 +85,10 @@ int main (int argc, char *argv [])
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"roundtrip count: %d
\n
"
,
(
int
)
roundtrip_count
);
printf
(
"roundtrip count: %d
\n
"
,
(
int
)
roundtrip_count
);
printf
(
"average latency: %3f [us]
\n
"
,
(
double
)
latency
);
printf
(
"average latency: %.3f [us]
\n
"
,
(
double
)
latency
);
rc
=
zmq_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
return
0
;
}
}
perf/c/remote_thr.c
View file @
f92de9b2
...
@@ -63,5 +63,8 @@ int main (int argc, char *argv [])
...
@@ -63,5 +63,8 @@ int main (int argc, char *argv [])
sleep
(
10
);
sleep
(
10
);
rc
=
zmq_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
return
0
;
}
}
perf/cpp/local_thr.cpp
View file @
f92de9b2
...
@@ -71,7 +71,7 @@ int main (int argc, char *argv [])
...
@@ -71,7 +71,7 @@ int main (int argc, char *argv [])
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message count: %d
\n
"
,
(
int
)
message_count
);
printf
(
"message count: %d
\n
"
,
(
int
)
message_count
);
printf
(
"mean throughput: %d [msg/s]
\n
"
,
(
int
)
throughput
);
printf
(
"mean throughput: %d [msg/s]
\n
"
,
(
int
)
throughput
);
printf
(
"mean throughput: %3f [Mb/s]
\n
"
,
(
double
)
megabits
);
printf
(
"mean throughput: %
.
3f [Mb/s]
\n
"
,
(
double
)
megabits
);
return
0
;
return
0
;
}
}
perf/cpp/remote_lat.cpp
View file @
f92de9b2
...
@@ -64,7 +64,7 @@ int main (int argc, char *argv [])
...
@@ -64,7 +64,7 @@ int main (int argc, char *argv [])
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"roundtrip count: %d
\n
"
,
(
int
)
roundtrip_count
);
printf
(
"roundtrip count: %d
\n
"
,
(
int
)
roundtrip_count
);
printf
(
"average latency: %3f [us]
\n
"
,
(
double
)
latency
);
printf
(
"average latency: %
.
3f [us]
\n
"
,
(
double
)
latency
);
return
0
;
return
0
;
}
}
src/session.cpp
View file @
f92de9b2
...
@@ -36,11 +36,8 @@ zmq::session_t::session_t (object_t *parent_, socket_base_t *owner_,
...
@@ -36,11 +36,8 @@ zmq::session_t::session_t (object_t *parent_, socket_base_t *owner_,
zmq
::
session_t
::~
session_t
()
zmq
::
session_t
::~
session_t
()
{
{
// Ask associated pipes to terminate.
zmq_assert
(
!
in_pipe
);
if
(
in_pipe
)
zmq_assert
(
!
out_pipe
);
in_pipe
->
term
();
if
(
out_pipe
)
out_pipe
->
term
();
}
}
bool
zmq
::
session_t
::
read
(
::
zmq_msg_t
*
msg_
)
bool
zmq
::
session_t
::
read
(
::
zmq_msg_t
*
msg_
)
...
@@ -82,6 +79,7 @@ void zmq::session_t::attach_inpipe (reader_t *pipe_)
...
@@ -82,6 +79,7 @@ void zmq::session_t::attach_inpipe (reader_t *pipe_)
active
=
true
;
active
=
true
;
in_pipe
->
set_endpoint
(
this
);
in_pipe
->
set_endpoint
(
this
);
}
}
void
zmq
::
session_t
::
attach_outpipe
(
writer_t
*
pipe_
)
void
zmq
::
session_t
::
attach_outpipe
(
writer_t
*
pipe_
)
{
{
zmq_assert
(
!
out_pipe
);
zmq_assert
(
!
out_pipe
);
...
@@ -141,6 +139,16 @@ void zmq::session_t::process_unplug ()
...
@@ -141,6 +139,16 @@ void zmq::session_t::process_unplug ()
bool
ok
=
owner
->
unregister_session
(
name
.
c_str
());
bool
ok
=
owner
->
unregister_session
(
name
.
c_str
());
zmq_assert
(
ok
);
zmq_assert
(
ok
);
// Ask associated pipes to terminate.
if
(
in_pipe
)
{
in_pipe
->
term
();
in_pipe
=
NULL
;
}
if
(
out_pipe
)
{
out_pipe
->
term
();
out_pipe
=
NULL
;
}
if
(
engine
)
{
if
(
engine
)
{
engine
->
unplug
();
engine
->
unplug
();
delete
engine
;
delete
engine
;
...
...
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