News for hackers. Stuff that matters.
Re:Go 1.2 Release Candidate 1 released by drsintoma on Friday September 20, 2013 @06:45AM (#6416949)
Has anyone tried the new scheduler?

Does this still block forever?

package main

import "time"

func main() { go func(){ for {} }() time.Sleep(time.Millisecond) }

Re:Go 1.2 Release Candidate 1 released by ominous_prime on Friday September 20, 2013 @09:36AM (#6417589)
while they have added some preemption to the scheduler, go is still generally cooperative multitasking. I believe function calls are also schedule points now. If you have a cpu-intensive loop you want to yield from at certain points, stick a runtime.GoSched in there. Having a busy-loop in your code is going to mess things up, and is usually a bug anyway.
Re:Go 1.2 Release Candidate 1 released by masklinn on Friday September 20, 2013 @10:13AM (#6417796)
> Having a busy-loop in your code is going to mess things up, and is usually a bug anyway.

A busy loop is a sufficient way to emulate a heavy computation (e.g. applying effects to image files or compressing data) when it's not optimized out.

Re:Go 1.2 Release Candidate 1 released by Skinney on Friday September 20, 2013 @07:39AM (#6417090)
That will still block forever. If you include a function call in the loop though, it won't.
Re:Go 1.2 Release Candidate 1 released by drsintoma on Friday September 20, 2013 @06:53AM (#6416969)
Ok, I just tried it. It still does.