Hi,

I would like to ask you for an advice. In my application, I am going to have several groups of clients, that are logically separated. I want each group to run in a separate thread, because these groups can have very uneven CPU requirements and I don't want one group to block another.

I have done it using a combination of vibe.d and std.concurrency.

Each launched thread has this kind of processing loop:

while(!mustFinish)
{
  // Process events from controlling thread
  std.concurrency.receiveTimeout( 0.msecs,
    ...
  );
  // Process tasks
  processEvents();
}

Now, I would like to ask you two questions:

  • Is this a sensible approach, or is it noticeably suboptimal?
  • I have noticed that from the last time I checked vibe.d has advanced its concurrency implementation. Should/can I do this using just the vibe.d code without mixing in the std.concurrency module?

Thank you.

Cheers, Drasha