Go - buffered channel


  • Declare a queue: ch := make(chan int, 3)
  • Block send when full, block receive when empty
  • Get capacity: cap(ch)
  • Get currently buffered: len(ch)
  • Buffered channel behaves as a queue, but should use slice if only need a queue


沒有留言:

張貼留言

Lessons Learned While Benchmarking vLLM with GPU

Recently, I benchmarked vLLM on a GPU to better understand how much throughput can realistically be expected in an LLM serving setup. One ...