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
85c2a840
Commit
85c2a840
authored
Apr 02, 2011
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inproc perf tests now work on Windows
Signed-off-by:
Martin Sustrik
<
sustrik@250bpm.com
>
parent
54830ac0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
458 additions
and
4 deletions
+458
-4
inproc_lat.vcproj
builds/msvc/inproc_lat/inproc_lat.vcproj
+174
-0
inproc_thr.vcproj
builds/msvc/inproc_thr/inproc_thr.vcproj
+174
-0
msvc.sln
builds/msvc/msvc.sln
+22
-0
inproc_lat.cpp
perf/inproc_lat.cpp
+44
-2
inproc_thr.cpp
perf/inproc_thr.cpp
+44
-2
No files found.
builds/msvc/inproc_lat/inproc_lat.vcproj
0 → 100644
View file @
85c2a840
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"9.00"
Name=
"inproc_lat"
ProjectGUID=
"{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}"
RootNamespace=
"inproc_lat"
TargetFrameworkVersion=
"196613"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
WarningLevel=
"3"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"../../../bin/inproc_lat.exe"
GenerateDebugInformation=
"true"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"2"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"2"
EnableIntrinsicFunctions=
"true"
RuntimeLibrary=
"2"
EnableFunctionLevelLinking=
"true"
WarningLevel=
"3"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"../../../bin/inproc_lat.exe"
GenerateDebugInformation=
"true"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\..\..\perf\inproc_lat.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
builds/msvc/inproc_thr/inproc_thr.vcproj
0 → 100644
View file @
85c2a840
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"9.00"
Name=
"inproc_thr"
ProjectGUID=
"{1077E977-95DD-4E73-A692-74647DD0CC1E}"
RootNamespace=
"inproc_thr"
TargetFrameworkVersion=
"196613"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
WarningLevel=
"3"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"../../../bin/inproc_thr.exe"
GenerateDebugInformation=
"true"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"2"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"2"
EnableIntrinsicFunctions=
"true"
RuntimeLibrary=
"2"
EnableFunctionLevelLinking=
"true"
WarningLevel=
"3"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"../../../bin/inproc_thr.exe"
GenerateDebugInformation=
"true"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\..\..\perf\inproc_thr.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
builds/msvc/msvc.sln
View file @
85c2a840
...
...
@@ -23,6 +23,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_thr", "c_remote_thr\
{641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_lat", "inproc_lat\inproc_lat.vcproj", "{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}"
ProjectSection(ProjectDependencies) = postProject
{641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_thr", "inproc_thr\inproc_thr.vcproj", "{1077E977-95DD-4E73-A692-74647DD0CC1E}"
ProjectSection(ProjectDependencies) = postProject
{641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
...
...
@@ -60,6 +70,18 @@ Global
{B15E059C-0CBB-4A82-8C42-6567FB650802}.Release|Win32.Build.0 = Release|Win32
{B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|Win32.Build.0 = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Debug|Win32.ActiveCfg = Debug|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Debug|Win32.Build.0 = Debug|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|Win32.ActiveCfg = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|Win32.Build.0 = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|Win32.Build.0 = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Debug|Win32.ActiveCfg = Debug|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Debug|Win32.Build.0 = Debug|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|Win32.ActiveCfg = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|Win32.Build.0 = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
perf/inproc_lat.cpp
View file @
85c2a840
...
...
@@ -24,19 +24,31 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../src/platform.hpp"
#if defined ZMQ_HAVE_WINDOWS
#include <windows.h>
#include <process.h>
#else
#include <pthread.h>
#endif
static
size_t
message_size
;
static
int
roundtrip_count
;
static
void
*
worker
(
void
*
ctx
)
#if defined ZMQ_HAVE_WINDOWS
static
unsigned
int
__stdcall
worker
(
void
*
ctx_
)
#else
static
void
*
worker
(
void
*
ctx_
)
#endif
{
void
*
s
;
int
rc
;
int
i
;
zmq_msg_t
msg
;
s
=
zmq_socket
(
ctx
,
ZMQ_REP
);
s
=
zmq_socket
(
ctx
_
,
ZMQ_REP
);
if
(
!
s
)
{
printf
(
"error in zmq_socket: %s
\n
"
,
zmq_strerror
(
errno
));
exit
(
1
);
...
...
@@ -79,12 +91,20 @@ static void *worker (void *ctx)
exit
(
1
);
}
#if defined ZMQ_HAVE_WINDOWS
return
0
;
#else
return
NULL
;
#endif
}
int
main
(
int
argc
,
char
*
argv
[])
{
#if defined ZMQ_HAVE_WINDOWS
HANDLE
local_thread
;
#else
pthread_t
local_thread
;
#endif
void
*
ctx
;
void
*
s
;
int
rc
;
...
...
@@ -120,11 +140,20 @@ int main (int argc, char *argv [])
return
-
1
;
}
#if defined ZMQ_HAVE_WINDOWS
local_thread
=
(
HANDLE
)
_beginthreadex
(
NULL
,
0
,
worker
,
ctx
,
0
,
NULL
);
if
(
local_thread
==
0
)
{
printf
(
"error in _beginthreadex
\n
"
);
return
-
1
;
}
#else
rc
=
pthread_create
(
&
local_thread
,
NULL
,
worker
,
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in pthread_create: %s
\n
"
,
zmq_strerror
(
rc
));
return
-
1
;
}
#endif
rc
=
zmq_msg_init_size
(
&
msg
,
message_size
);
if
(
rc
!=
0
)
{
...
...
@@ -165,11 +194,24 @@ int main (int argc, char *argv [])
latency
=
(
double
)
elapsed
/
(
roundtrip_count
*
2
);
#if defined ZMQ_HAVE_WINDOWS
DWORD
rc2
=
WaitForSingleObject
(
local_thread
,
INFINITE
);
if
(
rc
==
WAIT_FAILED
)
{
printf
(
"error in WaitForSingleObject
\n
"
);
return
-
1
;
}
BOOL
rc3
=
CloseHandle
(
local_thread
);
if
(
rc3
==
0
)
{
printf
(
"error in CloseHandle
\n
"
);
return
-
1
;
}
#else
rc
=
pthread_join
(
local_thread
,
NULL
);
if
(
rc
!=
0
)
{
printf
(
"error in pthread_join: %s
\n
"
,
zmq_strerror
(
rc
));
return
-
1
;
}
#endif
printf
(
"average latency: %.3f [us]
\n
"
,
(
double
)
latency
);
...
...
perf/inproc_thr.cpp
View file @
85c2a840
...
...
@@ -24,19 +24,31 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../src/platform.hpp"
#if defined ZMQ_HAVE_WINDOWS
#include <windows.h>
#include <process.h>
#else
#include <pthread.h>
#endif
static
int
message_count
;
static
size_t
message_size
;
static
void
*
worker
(
void
*
ctx
)
#if defined ZMQ_HAVE_WINDOWS
static
unsigned
int
__stdcall
worker
(
void
*
ctx_
)
#else
static
void
*
worker
(
void
*
ctx_
)
#endif
{
void
*
s
;
int
rc
;
int
i
;
zmq_msg_t
msg
;
s
=
zmq_socket
(
ctx
,
ZMQ_PUB
);
s
=
zmq_socket
(
ctx
_
,
ZMQ_PUB
);
if
(
!
s
)
{
printf
(
"error in zmq_socket: %s
\n
"
,
zmq_strerror
(
errno
));
exit
(
1
);
...
...
@@ -77,12 +89,20 @@ static void *worker (void *ctx)
exit
(
1
);
}
#if defined ZMQ_HAVE_WINDOWS
return
0
;
#else
return
NULL
;
#endif
}
int
main
(
int
argc
,
char
*
argv
[])
{
#if defined ZMQ_HAVE_WINDOWS
HANDLE
local_thread
;
#else
pthread_t
local_thread
;
#endif
void
*
ctx
;
void
*
s
;
int
rc
;
...
...
@@ -125,11 +145,20 @@ int main (int argc, char *argv [])
return
-
1
;
}
#if defined ZMQ_HAVE_WINDOWS
local_thread
=
(
HANDLE
)
_beginthreadex
(
NULL
,
0
,
worker
,
ctx
,
0
,
NULL
);
if
(
local_thread
==
0
)
{
printf
(
"error in _beginthreadex
\n
"
);
return
-
1
;
}
#else
rc
=
pthread_create
(
&
local_thread
,
NULL
,
worker
,
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in pthread_create: %s
\n
"
,
zmq_strerror
(
rc
));
return
-
1
;
}
#endif
rc
=
zmq_msg_init
(
&
msg
);
if
(
rc
!=
0
)
{
...
...
@@ -174,11 +203,24 @@ int main (int argc, char *argv [])
return
-
1
;
}
#if defined ZMQ_HAVE_WINDOWS
DWORD
rc2
=
WaitForSingleObject
(
local_thread
,
INFINITE
);
if
(
rc
==
WAIT_FAILED
)
{
printf
(
"error in WaitForSingleObject
\n
"
);
return
-
1
;
}
BOOL
rc3
=
CloseHandle
(
local_thread
);
if
(
rc3
==
0
)
{
printf
(
"error in CloseHandle
\n
"
);
return
-
1
;
}
#else
rc
=
pthread_join
(
local_thread
,
NULL
);
if
(
rc
!=
0
)
{
printf
(
"error in pthread_join: %s
\n
"
,
zmq_strerror
(
rc
));
return
-
1
;
}
#endif
rc
=
zmq_close
(
s
);
if
(
rc
!=
0
)
{
...
...
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