Hey folks,

I'm working on a server-side Javascript rendering package in Go. It uses 
https://bellard.org/quickjs/ for it's parser and interpreter. I'm using 
https://github.com/lithdew/quickjs to package it with Go.

Quickjs appears to have some thread-local memory, so I'm 
use runtime.LockOSThread() to make sure that the goroutine is always placed 
on the same thread. I'm using a worker pattern to distribute load.

The problem I'm running into is that sometimes worker's goroutines get 
scheduled (and then locked) to the same thread, effectively serializing the 
computation. This seems random and causes a loss in parallelism since these 
goroutines will remain on the same thread through their lifetime.

Are there any workarounds with this issue?

Thanks!
Matt


-- 
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/c1e1e698-c227-42a4-bdc9-332ea15509f9o%40googlegroups.com.

Reply via email to