[nanomsg] Re: newbie question about protocol choosing

  • From: Daniel Bryan <danbryan@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Tue, 24 Dec 2013 09:07:47 +1100

Vasiliy Tolstov wrote:
>
> 2013/12/23 Jason E. Aten <j.e.aten@xxxxxxxxx>:
> > Why would you want a less-performant re-write of the library?
> >
> > go get github.com/op/go-nanomsg
> >
> > and you'll be up and going.
>
>
> In some cases i can't use cgo and external binding sometimes blocks
goroutine...

Yes, pending cgo calls can't be rescheduled by the goroutine scheduler. In
many applications, you can deal with this by setting GOMAXPROCS and
dedicating N goroutines to take messages off a channel and make the calls
at the cgo layer.

Not knowing too much about nanomsg yet, I can't see why you couldn't
implement the protocol natively in Go, but it seems like it would defeat
the purpose: libraries like zeroMQ and nanomsg are great partly because of
what they do at the low level wrt/ buffers, memory copy, latency, etc. None
of this is a great match for a garbage collected, opaquely scheduled
language like Go.

Why can't you use cgo? Is it because you're running in GAE?

Other related posts: