pool.ntp.org using Go

268 views
Skip to first unread message

Nick Sarten

unread,
Aug 24, 2012, 1:10:39 AM8/24/12
to golan...@googlegroups.com
I saw some interesting chatter on irc about part of pool.ntp.org being reimplemented in Go, and thought others on the mailing list might find it interesting.

<\ask> Hi everyone - I am just learning Go and ran into a surprise using a closure. I made a gist of it: https://gist.github.com/3445361
* irctc717 has quit (Ping timeout: 245 seconds)
<\ask> the "xmain" version there prints "b" twice; do I really have to setup the closure in a separate function as in the commented out version to have it work as I expected?
<jessta> quiznilo: gob is just a serialsation format that supports all Go types, it's faster to use gob than json in Go.
<davecheney> adg: what OS is your darwin builder running ?
* yoklov (~yok...@66-168-42-64.dhcp.nwtn.ct.charter.com) has joined #go-nuts
<quiznilo> \ask there is a FAQ question about that
<jessta> \ask: closures capture the variables not their values.
<\ask> quiznilo: The go_faq on golang.org ?
<james4k> yes which is so much more valuabe
<\ask> jessta: Ok, so the commented out version I had is the idiomatic version?
<james4k> valuable*
<quiznilo> \ask: It was http://golang.org/doc/go_faq.html#closures_and_goroutines which is *sort* of the same concept
<quiznilo> I was wrong
<james4k> no you wouldn't use a closure for that
<\ask> james4k: I think I can see that, it just wasn't for my first use case so I got surprised. So far there's otherwise been a lot of "do what I mean" goodness in Go. :-)
<WOFall> no you're right, it's exactly that faq
<\ask> quiznilo: thanks
<quiznilo> sure
<\ask> One of my hobbies is maintaining the pool.ntp.org system (which some of you probably use); my first Go project is re-implementing the DNS server that system uses in Go.
<quiznilo> I've used it :D
<quiznilo> wow
<quiznilo> kinda high-profile
* yoklov has quit (Quit: computer sleeping)
* reprisal (repr...@dereferenced.nullpointer.net) has joined #go-nuts
* allan_ (~al...@201-95-85-47.dsl.telesp.net.br) has joined #go-nuts
<james4k> sounds like a great use case
* reprisal is now known as william-s
<\ask> james4k: Yes, I hope so. The current server is implemented in Perl (with Net::DNS::Nameserver) and it's too slow.  At the top of the hour the system gets 5-10k queries a second and it can't keep up at all even with more than a dozen (mostly slow-ish) servers.

oran...@gmail.com

unread,
May 29, 2020, 12:27:28 PM5/29/20
to golang-nuts
Mode d'emplois
Reply all
Reply to author
Forward
0 new messages