Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-concurrency
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
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
typon
typon-concurrency
Commits
b7c7788b
Commit
b7c7788b
authored
Aug 11, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/: Remove obsolete programs
parent
e5e93a1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
86 deletions
+0
-86
rt/examples/naive_fibonacci_fork_bundle.cpp
rt/examples/naive_fibonacci_fork_bundle.cpp
+0
-27
rt/examples/naive_fibonacci_fork_drop.cpp
rt/examples/naive_fibonacci_fork_drop.cpp
+0
-32
rt/examples/naive_fibonacci_fork_refcnt.cpp
rt/examples/naive_fibonacci_fork_refcnt.cpp
+0
-27
No files found.
rt/examples/naive_fibonacci_fork_bundle.cpp
deleted
100644 → 0
View file @
e5e93a1d
#include <typon/typon.hpp>
#include <cstdio>
using
namespace
typon
;
using
namespace
typon
::
policy
;
Join
<
int
>
fibo
(
int
n
)
{
if
(
n
<
2
)
{
co_return
n
;
}
Forked
a
=
co_await
fork
<
Bundle
>
(
fibo
(
n
-
1
));
Forked
b
=
co_await
fork
<
Bundle
>
(
fibo
(
n
-
2
));
co_await
Sync
();
co_return
a
.
get
()
+
b
.
get
();
}
Root
root
()
{
int
result
=
co_await
fibo
(
40
);
printf
(
"%d
\n
"
,
result
);
}
int
main
()
{
root
().
call
();
puts
(
"done"
);
return
0
;
}
rt/examples/naive_fibonacci_fork_drop.cpp
deleted
100644 → 0
View file @
e5e93a1d
#include <typon/typon.hpp>
#include <cstdio>
using
namespace
typon
;
using
namespace
typon
::
policy
;
Join
<
int
>
fibo
(
int
n
,
int
&
result
)
{
if
(
n
<
2
)
{
result
=
n
;
co_return
n
;
}
// Danger !
// The memory for a and b could be freed before the forks complete
int
a
;
co_await
fork
<
Drop
>
(
fibo
(
n
-
1
,
a
));
int
b
;
co_await
fork
<
Drop
>
(
fibo
(
n
-
2
,
b
));
// This sync() ensures that the forks complete before a and b are freed
// As long as there are no exceptions...
co_await
Sync
();
result
=
a
+
b
;
}
Root
root
()
{
int
result
;
co_await
fibo
(
40
,
result
);
printf
(
"%d
\n
"
,
result
);
}
int
main
()
{
root
().
call
();
puts
(
"done"
);
return
0
;
}
rt/examples/naive_fibonacci_fork_refcnt.cpp
deleted
100644 → 0
View file @
e5e93a1d
#include <typon/typon.hpp>
#include <cstdio>
using
namespace
typon
;
using
namespace
typon
::
policy
;
Join
<
int
>
fibo
(
int
n
)
{
if
(
n
<
2
)
{
co_return
n
;
}
Forked
a
=
co_await
fork
<
Refcnt
>
(
fibo
(
n
-
1
));
Forked
b
=
co_await
fork
<
Refcnt
>
(
fibo
(
n
-
2
));
co_await
Sync
();
co_return
a
.
get
()
+
b
.
get
();
}
Root
root
()
{
int
result
=
co_await
fibo
(
40
);
printf
(
"%d
\n
"
,
result
);
}
int
main
()
{
root
().
call
();
puts
(
"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