"for co_await" was in the coroutine-ts but did not make it into
the C++20 standard. This patch translates the "for co_await"
which were used to standard for loops using "co_await".
This is necessary to compile on MSVC 1928 in with c++-latest.
First, std::uncought_exception() does not exist any more in
C++20, it is replaced by std::uncought_exceptions(). Second,
Second, in file_test.cpp we have to include <string>
to use std::to_string.
The awaiting coroutine will be resumed using the scheduler if it
is suspended waiting for a sequence number. This simplifies code
as the caller doesn't need to remember to manually reschedule.
Forcing a scheduler to provided also prevents the producer/consumer
coroutines from effectively becoming single-threaded.
This will allow them to be run on Linux platforms.
Change producer in multi-producer examples to reschedule onto the
thread-pool if probably suspended. This allows producer and
consumer to run concurrently rather than the consumer executing
the producer inline.
Disabled a CHECK() for the thread that the schedule_on() operator
resumes on since the outcome is actually not guaranteed with the
current implementation of task<T>. See #79 for details.
MSVC was inlining local variables in await_suspend() into the
coroutine frame of the caller which was breaking the guarantees
required by the for_each_async() test.
This allows parallel execution of a bulk operation using only
a single coroutine frame. The continuation of the loop is eligible
to be stolen by other threads while executing the current iteration.
- thread_state::m_mask was being incorrectly initialised
- Modified try_local_enqueue() to attempt to enlarge the local
queue if it looks like it's run out of space.
- Removed doubly-linked list from schedule_operation as it wasn't
needed.
- Catch any potential exceptions thrown by auto_reset_event::wait()
and just sleep for 1ms in this case rather than terminating the
thread.
- Adds cppcoro::net::socket class with support for TCP/UDP
over IPv4 or IPv6.
- Adds async accept/connect/disconnect/send/recv operations in
both cancellable and non-cancellable variants.
- Still need to add send_to/recv_from as well as overloads for
multi-buffer send/recv.
- Move common logic for Win32 OVERLAPPED-based operations out into
new win32_overlapped_operation[_cancellable] base-classes.
The concrete I/O operation classes are now greatly simplified
due to the reduction of boilerplate.
- Added overloads for read() and write() functions that don't
take a cancellation_token that return a simpler awaitable type
that generates much simpler assembly.