On Mon, 9 Oct 2017 23:03:42 +0200, Sönke Ludwig wrote:

Currently, concurrent writes are forbidden and will usually lead to an
assertion failure. A TaskMutex needs to be used to ensure exclusive
access. The same applies also to concurrent reads.

Got it! however I really like lock-free development.
Do you think something like

Queue writeQueue;
runTask({
  // I'm the writing task
  while (writeQueue.pop(...)) {
    // do the writing
  }
});

asyncTask({
  writeQueue.push({
    // do the send
  });
});

writeQueue.push({
  // do another send
});

would be nicer?
if so, could you point me in the right direction.
I only found "core.task.MessageQueue", but I'm not sure it'd be the right choice. Or maybe rather like in the chat tutorial by using ManualEvent on combination with a simple ubyte[] list?

On Mon, 9 Oct 2017 23:03:42 +0200, Sönke Ludwig wrote:

However, in later versions of eventcore (which will be the default event
loop abstraction), it is planned to enqueue reads and writes in the
order in which they get initiated, so the code above would become legal.
Under the normal semantics, lotsOfData0 would then be sent first, as
runTask will eagerly start to execute the task before returning after
the first yield/blocking operation occurred.

lovely!