1. Removes the marker task used by schedule() and instead limits the number of task resumptions to the initial length of the task queue
2. Assigns a static and a dynamic priority to each task. The dynamic priority starts with the same value as the static priority and gets incremented by the static priority each time the task gets overtaken by a higher priority task, eventually leading to the task becoming the highest priority (unless the static priority is zero). Tasks with a higher dynamic priority generally take precedence, unless the concurrency exceeds 10 scheduled tasks, in which case the front of the queue is scheduled in normal FIFO order.
Uses std.encoding.sanitize, which returns the original string, if all code points are properly encoded. Note that the performance could still be improved considerably by iterating over multiple bytes at once, fast skipping over characters that don't have the most significant bit set.
Uninitialized YieldLock values can happen in various ways, dispite the default constructor being disabled. If any such value got destroyed, it would lead to a negative lock count. Since this is handled properly now, the default constructor is also enabled in this commit.
- Deprecates Format.decodeSegment (returning a range of GemericPath.Segment) and added decodeSingleSegment instead, which returns a string instead.
- Adds Format.encodeSegment to encode a single path segment
Instead of asyncWork, now uses a worker task directly and signals the finalization of the result using message passing. This avoids the roundtrip required to return the task handle, as well as the heap allocated result buffer of Future!T.
Instead of starting at zero, start at the current file size. This offset
is stored in FileStream. It is only an approximation because concurrent
writes could advance the file without FileStream's knowledge.
Add a test that shows that the offset is approximated as expected and that
appending to an existing file works, too.
This is also a regression test which shows that appending to an existing
file works as expected. See vibe-d/eventcore#115.
This change ensures that a return value of false guarantees the next call to consumeOne to succeed, meaning that the combination of empty/consumeOne is sound in a single-consumer scenario. This also updates the documentation to stress that tryConsumeOne is still the preferred API.
Makes sure that the task finalization finishes (including notifying possibly multiple joiners) before the fiber yields, because it won't be resumed by the scheduler before the next task gets assigned to the fiber.
- Task.join and Task.interrupt are now thread-safe
- TaskFiber.task returns Task.init if no task is running (avoids bogus resumes of the TaskFiber by the scheduler)
To enable thread-safe join/interrupt, the task counter is now stored together with the necessary flags within a single shared ulong that is manipulated atomically.
Allows to disconnect all connections that are not currently in use. In particular, it allows to close all connections at shutdown to avoid leaking socket descriptors.
Avoids listDirectory/iterateDirectory getting interrupted when stumbling over inaccessible files. The `name` field of the returned file info value is always set, so that these files can still be identified.
`runApplication` takes an `args_out` parameter which, if non-null, is
supposed to be set to match unrecognized command-line args. However,
the parameter is never passed to `finalizeCommandLineOptions`, which
will therefore log an error and throw an exception if any command line
arguments are unrecognized.
This patch fixes the oversight, ensuring that `runApplication` will
correctly populate a non-null `args_out` parameter with unrecognized
command-line arguments, and not throw an exception in this case.
It seems when running in a vibe-d app that the assert fails
Even though I would like there to be a check, closing the vibe.d
app afterwards shows no leaked handles so I think it's fine.
- allows all methods to be called on a `shared(Channel!T)` instance.
- `Channel` pre-defines the `buffer_size` argument to 100, matching `createChannel`