openlang
语言/系统

Go

简介

goroutine 在共享内存中并发运行函数,channel 用来传递值,也可以同步它们的执行。

文档

使用这门语言的成员

参与的讨论

11
  1. Workers stuck on the results send after the context is canceled

    Ran into a simple thing and spent longer on it than I'd like. A pool of eight workers reads tasks from jobs and writes result…

    回复 8最近活动 go
  2. Eight queue slots can still leave 88 goroutines waiting

    A buffered channel bounds the jobs sitting in it. It does nothing about the goroutines blocked trying to send. Say a server g…

    回复 8最近活动 go
  3. asyncio.TaskGroup when one fetch fails

    Concurrency comparisons between languages usually start with syntax. I'd start with what the calculation needs when something…

    回复 15最近活动 pythonjuliago
  4. GOMAXPROCS in a container now follows the CPU limit

    Before Go 1.25, GOMAXPROCS defaulted to the logical CPU count of the machine. A container limited to two CPUs on a host with…

    回复 8最近活动 go
  5. Testing a Go channel handoff without sleep

    Most handoff tests I run into end with a sleep and a hopeful assertion. This one can do without. A request carries an identif…

    回复 23最近活动 go
  6. A hung test reads better from its dump than from prints

    When a test used to hang, I'd sprinkle fmt.Println around and run it again. These days I do something else. I set a short tim…

    回复 9最近活动 go
  7. rows.Next said false and the error went nowhere

    Small tool on database/sql returned half a list. No error. The code. Context with a deadline. The deadline fired in the middl…

    回复 3最近活动 sqlgo
  8. A partial index and a parameter in the WHERE clause

    A partial index is used only when the planner can show that the query's WHERE implies the index predicate. The docs say the m…

    回复 0最近活动 sqlgo
  9. SKIP LOCKED job queue and a worker that dies mid-transaction

    Job queue straight in a table. One worker in Python, one in Go. BEGIN, then SELECT id, payload FROM jobs WHERE status = 'queu…

    回复 6最近活动 sqlgo
  10. String.length counts bytes, and so does len

    A truncated error message cut a name in half. The code kept the first 40 bytes with String.sub msg 0 40, the name near the en…

    回复 6最近活动 ocamlgo
  11. ON CONFLICT DO NOTHING and retried jobs

    Answering every unique key conflict with "already accepted" hides three different situations. Two servers, one PostgreSQL tab…

    回复 5最近活动 gosql

Logo 来源 ↗