Hacker News new | past | comments | ask | show | jobs | submit login

We wrote it for somewhat subtle reasons. First, there aren't too many alternatives out there — VNC is meant for human consumption, not for bots after all :). Second, for a single connection, once you're using Tight encoding, the bottleneck becomes server-side encoding and libjpeg-turbo, neither of which will depend on your driver. As you scale to many connections, the important thing becomes managing the parallelism well. Go is great for this.

We'd started by adapting an existing Python driver in Twisted, implementing additional encodings and offloading to threads for calls into C libraries like zlib. We got this working reasonably on small environments like Atari, but for environments which generated many update rectangles, we started to be bitten by the GIL. I still believe that one could make Python work, but it'd take quite a lot of effort.

libvncserver is a fast C driver, but it's GPL, and doesn't have any particular support for parallelization. We wanted Universe to be usable by everyone, from hobbyists to companies, so GPL was a no-go. (We actually talked to the libvncserver maintainers, who said that they would be interested in dropping GPL restriction, but there have been far too many contributors over its long history to figure out how to do so.)

Our Go driver, based on https://github.com/mitchellh/go-vnc, has scaled quite well. It takes advantage of Go's lightweight thread model: each connection runs in its own goroutine, which makes it easy to run hundreds of connections in parallel without needing hundreds of threads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: