タグ

2016年11月14日のブックマーク (2件)

  • sync.ErrGroupで複数のgoroutineを制御する

    Golangの並行処理は強力である一方で同期処理を慎重に実装する必要がある.“Go 言語における並行処理の構築部材”にまとめられているようにGolangは様々な方法でそれを実装することができる.実現したいタスクに合わせてこれらを適切に選択する必要がある. この同期処理の機構として新たにgolang.org/x/sync/errgroupというパッケージが登場した.実際に自分のツールで使ってみて便利だったので簡単に紹介する. 使いどころ 時間のかかる1つのタスクを複数のサブタスクとして並行実行しそれらが全て終了するのを待ち合わせる処理(Latch)を書きたい場合にerrgroupは使える.その中でも「1つでもサブタスクでエラーが発生した場合に他のサブタスクを全てを終了しエラーを返したい」(複数のサブタスクが全て正常に終了して初めて1つの処理として完結する)場合が主な使いどころである. 実例

    oinume
    oinume 2016/11/14
    複数のgoroutineがあってエラーを返す場合に便利そう
  • LSI - LSI MegaCLI commands and optimizations

    LSI Overview LSI is now owned by Avago Technologies. The models and cards remain the same, however the names may change down the road. This wiki and the commands below are all based on the LSI-9260 4/8/16i models, and the commands should also work for the LSI 9266 line, as well as the 9270/9271 line. If you have a newer model than what is mentioned above, please use caution before you run any comm