Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
f56122a5
Commit
f56122a5
authored
Jul 30, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed obsolete files
parent
2b2c3c51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
132 deletions
+0
-132
gen_server/Makefile
gen_server/Makefile
+0
-8
gen_server/parallel_send.cpp
gen_server/parallel_send.cpp
+0
-67
gen_server/sequential_send.cpp
gen_server/sequential_send.cpp
+0
-57
No files found.
gen_server/Makefile
deleted
100644 → 0
View file @
2b2c3c51
#CXX = /opt/local/bin/g++-mp-4.6
CXX
=
/opt/local/bin/g++-mp-4.6
CXXFLAGS
=
-std
=
c++0x
-pedantic
-Wall
-Wextra
-I
/opt/local/include/
-I
../
-fpermissive
LIBS
=
-L
../.libs/
-lcppa
-L
/opt/local/lib
-L
/usr/lib
-lboost_thread-mt
all
:
$(CXX)
$(CXXFLAGS)
-o
sequential_send sequential_send.cpp
$(LIBS)
# $(CXX) $(CXXFLAGS) -o parallel_send parallel_send.cpp $(LIBS)
gen_server/parallel_send.cpp
deleted
100644 → 0
View file @
2b2c3c51
#include <iostream>
#include "cppa/cppa.hpp"
#include <boost/progress.hpp>
using
std
::
cout
;
using
std
::
endl
;
using
boost
::
timer
;
using
namespace
cppa
;
void
counter_actor
()
{
long
count
=
0
;
receive_loop
(
on
<
atom
(
"Get"
),
actor_ptr
>
()
>>
[
&
](
actor_ptr
client
)
{
send
(
client
,
count
);
count
=
0
;
},
on
<
atom
(
"AddCount"
),
long
>
()
>>
[
&
](
long
val
)
{
count
+=
val
;
}
);
}
constexpr
long
s_val
=
100
;
void
send_range
(
actor_ptr
counter
,
actor_ptr
parent
,
int
from
,
int
to
)
{
for
(
int
i
=
from
;
i
<
to
;
++
i
)
{
send
(
counter
,
atom
(
"AddCount"
),
s_val
);
}
send
(
parent
,
atom
(
"Done"
));
}
long
the_test
(
int
msg_count
)
{
actor_ptr
self_ptr
=
self
();
auto
counter
=
spawn
(
counter_actor
);
for
(
int
i
=
1
;
i
<
(
msg_count
/
1000
);
++
i
)
{
spawn
(
send_range
,
counter
,
self_ptr
,
(
i
-
1
)
*
1000
,
i
*
1000
);
}
auto
rule
=
on
<
atom
(
"Done"
),
any_type
*>
()
>>
[]()
{
};
for
(
int
i
=
1
;
i
<
(
msg_count
/
1000
);
++
i
)
{
receive
(
rule
);
}
send
(
counter
,
atom
(
"Get"
),
self
());
long
result
=
0
;
receive
(
on
<
long
>
()
>>
[
&
](
long
value
)
{
result
=
value
;
}
);
send
(
counter
,
atom
(
":Exit"
),
exit_reason
::
user_defined
);
return
result
;
}
void
run_test
(
int
msg_count
)
{
timer
t0
;
long
count
=
the_test
(
msg_count
);
auto
elapsed
=
t0
.
elapsed
();
cout
<<
"Count is "
<<
count
<<
endl
<<
"Test took "
<<
elapsed
<<
" seconds"
<<
endl
<<
"Throughput = "
<<
(
msg_count
/
elapsed
)
<<
" per sec"
<<
endl
;
}
int
main
()
{
run_test
(
3000000
);
await_all_others_done
();
return
0
;
}
gen_server/sequential_send.cpp
deleted
100644 → 0
View file @
2b2c3c51
#include <iostream>
#include "cppa/cppa.hpp"
#include <boost/progress.hpp>
using
std
::
cout
;
using
std
::
endl
;
using
boost
::
timer
;
using
namespace
cppa
;
void
counter_actor
()
{
long
count
=
0
;
receive_loop
(
on
<
atom
(
"AddCount"
),
long
>
()
>>
[
&
](
long
val
)
{
count
+=
val
;
},
on
<
atom
(
"Get"
),
actor_ptr
>
()
>>
[
&
](
actor_ptr
client
)
{
send
(
client
,
count
);
count
=
0
;
}
);
}
long
the_test
(
int
msg_count
)
{
constexpr
long
val
=
100
;
auto
counter
=
spawn
(
counter_actor
);
auto
msg
=
make_tuple
(
atom
(
"AddCount"
),
val
);
for
(
int
i
=
0
;
i
<
msg_count
;
++
i
)
{
counter
<<
msg
;
//send(counter, atom("AddCount"), val);
}
send
(
counter
,
atom
(
"Get"
),
self
);
long
result
=
0
;
receive
(
on
<
long
>
()
>>
[
&
](
long
value
)
{
result
=
value
;
}
);
send
(
counter
,
atom
(
":Exit"
),
exit_reason
::
user_defined
);
return
result
;
}
void
run_test
(
int
msg_count
)
{
timer
t0
;
long
count
=
the_test
(
msg_count
);
auto
elapsed
=
t0
.
elapsed
();
cout
<<
"Count is "
<<
count
<<
endl
<<
"Test took "
<<
elapsed
<<
" seconds"
<<
endl
<<
"Throughput = "
<<
static_cast
<
unsigned
long
>
(
msg_count
/
elapsed
)
<<
" per sec"
<<
endl
;
}
int
main
()
{
run_test
(
3000000
);
await_all_others_done
();
return
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