Avoiding allocation in broadcast server

Casper Færgemand" <shorttail at gmail.com> Casper Færgemand" <shorttail at gmail.com>
Fri Feb 7 14:04:29 PST 2014


Suppose I have a multi client broadcast server. One client sends 
a string, every client receives it. The client read thread reads 
the input from the client into a static byte array, makes a copy 
and casts it to a string, and passes it to the host thread, which 
relays it to all client write threads. This is done with message 
passing. Is there a way it can be done without allocation? That 
is, currently I use .idup on the static array.


More information about the Digitalmars-d-learn mailing list