Re: Constant GC allocations when sending large messages to threads?

2020-02-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/2/20 12:13 PM, cc wrote: On Friday, 31 January 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: You could use RefCounted to build a struct that then is sendable with the data you need. RefCounted allocates using C malloc, not the GC. Thanks for the tips.  How exactly would I go about

Re: Constant GC allocations when sending large messages to threads?

2020-02-02 Thread cc via Digitalmars-d-learn
On Friday, 31 January 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: You could use RefCounted to build a struct that then is sendable with the data you need. RefCounted allocates using C malloc, not the GC. Thanks for the tips. How exactly would I go about sending a RefCounted value?

Re: Constant GC allocations when sending large messages to threads?

2020-01-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/31/20 2:14 AM, cc wrote: On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven Schveighoffer wrote: I'm pretty sure std.concurrency uses Variant to pass message data, which boxes when it gets over a certain size. You are probably crossing that threshold. The allocations should level out

Re: Constant GC allocations when sending large messages to threads?

2020-01-31 Thread bauss via Digitalmars-d-learn
On Friday, 31 January 2020 at 07:14:30 UTC, cc wrote: On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven Schveighoffer wrote: I'm pretty sure std.concurrency uses Variant to pass message data, which boxes when it gets over a certain size. You are probably crossing that threshold. The

Re: Constant GC allocations when sending large messages to threads?

2020-01-30 Thread cc via Digitalmars-d-learn
On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven Schveighoffer wrote: I'm pretty sure std.concurrency uses Variant to pass message data, which boxes when it gets over a certain size. You are probably crossing that threshold. The allocations should level out eventually when the GC starts

Re: Constant GC allocations when sending large messages to threads?

2020-01-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/29/20 2:48 PM, cc wrote: Given the sample program at https://pastebin.com/u9sSNtj7 I'm experiencing GC allocations with every call to std.concurrency.send when sending larger messages (e.g. multiple ulongs).  These do not occur when sending uints in comparison, in the provided example.

Constant GC allocations when sending large messages to threads?

2020-01-29 Thread cc via Digitalmars-d-learn
Given the sample program at https://pastebin.com/u9sSNtj7 I'm experiencing GC allocations with every call to std.concurrency.send when sending larger messages (e.g. multiple ulongs). These do not occur when sending uints in comparison, in the provided example. For example, when the