On Sun, Oct 25, 2020 at 7:20 PM Tamás Gulácsi <tgulacs...@gmail.com> wrote:

> I'd put all that C-calling code in ONE goroution, with
> runtime.LockOSThread, and send commands to this thread through a channel,
> with a receiver chan for response, too.
> This way only one goroutine needs LockOSThread, and only that pays the
> memory penalty.
> If it becomes the bottleneck, you can easily ramp up several such
> "C-facing-worker-goroutines".
>
>
I'd do this too.

If not for anything else, it is a good foundation from which to start. Once
you know more about the behavior of the system, you can try to lessen up
the constraints, but chances are you don't have to ever. It depends on the
use case.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAGrdgiWo%3DZ%3D3wqcgMX_VFJK9yaHXr7nauYySJZpWaW%3DFF8%2BOgQ%40mail.gmail.com.

Reply via email to