1
0
Fork 0
mirror of https://gitlab.com/niansa/libcrosscoro.git synced 2025-03-06 20:53:32 +01:00
Commit graph

79 commits

Author SHA1 Message Date
Nils
db23d23637 Another cleanup (removed poll entirely) 2021-07-28 12:48:31 +02:00
Nils
cf6ef72276 Fixed coro.hpp header 2021-07-28 12:31:20 +02:00
niansa
9d83519b29 Fixed another typo 2021-07-28 10:17:54 +00:00
Nils
83341c7891 Merge branch 'master' of https://gitlab.com/niansa/libcrosscoro 2021-07-28 12:15:26 +02:00
Nils
eb8aea39b2 Other minor fixes in CMakeLists.txt 2021-07-28 12:14:39 +02:00
niansa
273d0a5bbb Minor fix in README.md 2021-07-28 10:11:26 +00:00
Nils
42f1212cde Removed empty gitmodules file 2021-07-28 12:10:33 +02:00
Nils
40cb369aab Formated 2021-07-28 12:09:16 +02:00
Nils
8dbad30d2c Minor cleanups and finished rename 2021-07-28 12:08:13 +02:00
Nils
e955a33c16 Removed github CI 2021-07-28 12:02:42 +02:00
Nils
c7612f5dba Updated readme and deleted githooks 2021-07-28 12:01:32 +02:00
Nils
4c506391b0 Removed README (will make a new one later) 2021-07-28 11:58:28 +02:00
Nils
73d8424008 But cleanup 2021-07-28 11:50:15 +02:00
Nils
d1263aebd7 Removed non-STL components 2021-07-28 11:43:57 +02:00
Josh Baldwin
285416bfe5
Add coro::resume_order_policy (#99)
lifo + fifo
2021-07-26 12:12:46 -06:00
Josh Baldwin
5de38b2d60
Issue 88/opensuse ci (#92)
* fix up g++ 11 warnings for unused return values
* Add opensuse/leap:15.2 CI build
* Add __attribute__((used)) for template functions

openSUSE/leap gcc on Release build seems to be aggressively
removing templates that are actually required, the used attribute
will force the compiler to leave them in.
2021-07-25 15:27:51 -06:00
Josh Baldwin
475bcf6d8b
std::shared_ptr<executor_type> for coro::shared_mutex (#86)
* std::shared_ptr<executor_type> for coro::shared_mutex

* implement remaining types that leverage executor or io_scheduler
2021-05-22 22:36:57 -06:00
Josh Baldwin
78b6e19927
Update docs on io_scheduler for inline processing (#84)
* Update docs on io_scheduler for inline processing

Support gcc 10.3.1 (fedora 33 updated)
Update ci.yml to run fedora 32,33,34 and support both
gcc 10.2.1 and 10.3.1

* fedora 32 -> gcc-c++ drop version

* Update ci.yml and test_latch.cpp
2021-05-22 19:58:46 -06:00
Josh Baldwin
310abc18bc
io_scheduler inline schedule_fd eventfd bug fix (#82)
The eventfd shutdown_fd was being reset instead of the schedule_fd,
this was causing a 100% cpu churn on scheduling the first task when
in inline mode.  This fixes it, and confirmed the throughput on the
inline scheduler has jumped quite a bit consistently.
2021-04-25 18:45:34 -06:00
Josh Baldwin
e9b225e42f
io_scheduler inline support (#79)
* io_scheduler inline support

* add debug info for io_scheduler size issue

* move poll info into its own file

* cleanup for feature

* Fix valgrind introduced use after free with inline processing

Running the coroutines inline with event processing caused
a use after free bug with valgrind detected in the inline
tcp server/client benchmark code.  Basically if an event
and a timeout occured in the same time period because the
inline processing would resume _inline_ with the event or the
timeout -- if the timeout and event occured in the same epoll_wait()
function call then the second one's coroutine stackframe would
already be destroyed upon resuming it so the poll_info->processed
check would be reading already free'ed memory.

The solution to this was to introduce a vector of coroutine handles
which are appended into on each epoll_wait() iteration of events
and timeouts, and only then after the events and timeouts are
deduplicated are the coroutine handles resumed.

This new vector has elided a malloc in the timeout function, but
there is still a malloc to extract the poll infos from the timeout
multimap data structure.  The vector is also on the class member
list and is only ever cleared, it is possible with a monster set
of timeouts that this vector could grow extremely large, but
I think that is worth the price of not re-allocating it.
2021-04-11 15:07:01 -06:00
Josh Baldwin
6220b61c68
coro::mutex uses function for unlocked state to reduce memory (#77) 2021-03-07 13:39:03 -07:00
Josh Baldwin
8ecd35af40
Backport bugs found from issue-72 (lockless thread_pool queue) (#75) 2021-03-07 11:08:31 -07:00
Josh Baldwin
19d626c1fb
coro::mutex remove std::mutex requirement, only 1 atomic with CAS (#71) 2021-02-27 14:46:37 -07:00
Josh Baldwin
fab634154f
Update README with section links (#70)
* Update README with section links

* add # to links

* try event instead of coro::event

* Update section names to remove "::" since markdown doesn't seem to link
properly with them
2021-02-27 12:33:42 -07:00
Josh Baldwin
078d18f7fe
coro::shared_mutex (#67) 2021-02-27 12:04:49 -07:00
Josh Baldwin
c1acf8b80d
coro::semaphore (#65)
* coro::semaphore

* coro::ring_buffer<E, N>
2021-02-23 11:05:21 -07:00
Josh Baldwin
6a2f398f9a
coro::when_all() always takes ownership (#63) 2021-02-17 10:50:51 -07:00
Josh Baldwin
4aee0dc6f8
coro::task_container example (#58) 2021-02-15 20:17:11 -07:00
Josh Baldwin
60a74af219
io_scheduler example (#57) 2021-02-15 18:52:45 -07:00
Josh Baldwin
017a4e2621
coro::when_all(tuple) use after free fix (#56) 2021-02-15 17:18:20 -07:00
Josh Baldwin
e1e52b1400
Add SSL/TLS support for TCP client/server via OpenSSL (#54)
* Add SSL/TLS support for TCP client/server via OpenSSL

* Comments addressed
2021-02-15 14:01:48 -07:00
Josh Baldwin
730928e8b5
Add coro::thread_pool example (#52) 2021-01-31 18:05:01 -07:00
Josh Baldwin
5ad45c3848
Add coro::task<T> example (#48)
* Add coro::task<T> example

* remove std::move on return statement in task example
2021-01-31 13:56:48 -07:00
Josh Baldwin
cb335b4474
Add coro::generator<T> example (#46) 2021-01-31 13:05:37 -07:00
Josh Baldwin
60994334fe
Add coro::mutex example to readme (#45)
* Add coro::mutex example to readme

* explicit lock_operation ctor

* lock_operation await_ready() uses try_lock

This allows for the lock operation to skip await_suspend() entirely
if the lock was unlocked.
2021-01-30 16:09:31 -07:00
Josh Baldwin
80fea9c49a
io_scheduler uses thread pool to schedule work (#42)
* io_scheduler uses thread pool to schedule work

fixes #41

* use task_container in bench tcp server test

* adjust benchmark for github actions CI

* fix io_scheduler tests cross thread memory boundaries

* more memory barriers

* sprinkle some shutdowns in there

* update readme
2021-01-24 19:34:39 -07:00
Josh Baldwin
95127e2f6e
Add coro::latch example (#40) 2021-01-17 11:38:14 -07:00
Josh Baldwin
03f78e2360
codacy and lgtm analysis (#37) 2021-01-16 20:51:37 -07:00
Josh Baldwin
8a64687510
coro::mutex (#35) 2021-01-16 20:27:11 -07:00
Josh Baldwin
bc3b956ed3
udp_peer! (#33)
* udp_peer!

I hope using the udp peer makes sense on how udp packets are
sent and received now.  Time will tell!

* Fix broken benchmark tcp server listening race condition
2021-01-09 19:18:03 -07:00
Josh Baldwin
92a42699bc
udp client + server (#31) 2021-01-08 20:28:55 -07:00
Josh Baldwin
f81acc9fcd
tcp client <-> server benchmarket (#29)
fixes #28
2020-12-31 17:24:11 -07:00
Josh Baldwin
290cb85aca
rename tcp_scheduler to tcp_server (#27) 2020-12-31 14:42:26 -07:00
Josh Baldwin
6faafa0688
Refactor net and into cpp files (#25) 2020-12-31 13:53:13 -07:00
Josh Baldwin
c02aefe26e
libc-ares dns client for hostname -> ip addres lookups (#24)
* libc-ares dns client for hostname -> ip addres lookups

* Add tcp_client dns lookup if hostname + dns available
2020-12-29 17:19:26 -07:00
Josh Baldwin
e11058ef22
tcp_client (#22)
* tcp_client

fixes #21

* remove double ci build
2020-12-27 14:32:03 -07:00
Josh Baldwin
b15c7c1d16
io_scheduler support timeouts (#20)
* io_scheduler support timeouts

Closes #19

* io_scheduler resume_token<poll_status> for poll()

* io_scheduler read/write now use poll_status + size return
2020-11-11 23:06:42 -07:00
Josh Baldwin
1c7b340c72
add tcp_scheduler (#18)
Closes #17
2020-11-01 18:46:41 -07:00
Josh Baldwin
ddd3c76c53
Rename scheduler to io_scheduler (#16)
Closes #15
2020-11-01 12:08:09 -07:00
Josh Baldwin
76b41a6ca0
Scheduler now correctly co_await's the user tasks from cleanup task (#14)
Previously it set the continuation manually, which sort of works but
is not canonical.
2020-10-28 17:35:23 -06:00