It should work to just set the finalizer on the first byte of an
allocation. i.e.:
s := make([]byte, N)
runtime.SetFinalizer(&s[0], func(b *byte) { ... })
Note that the spec of runtime.SetFinalizer doesn't actually guarantee that
this will work. But I think in the current implementation it will
Use read and expand the buffer as needed (or write the chunks to a file). If at
the end it is all going to be in memory, you might as well start with the very
large buffer. There is nothing special about Go in this regard - it’s standard
IO processing.
> On Dec 29, 2019, at 9:21 AM, Ron Wahler
I agree. I meant that worker pools are especially useful when you can do cpu
affinity - doesn’t apply to Go.
I think Go probably needs some idea of “capping” for cpu based workloads. You
can cap in the local N CPUs , but in a larger app that has multiple parallel
processing points you can easy
Jake,
Thanks for the reply. Csrc.Read is what I was referring to as the
connection standard read, should not have used the words "standard read"
sorry about that. The problem I am trying to solve is reading an unknown
amount of byte data. I am trying to understand what triggers the
Csrc.Read(