並び順

ブックマーク数

期間指定

  • から
  • まで

321 - 360 件 / 436件

新着順 人気順

mutexの検索結果321 - 360 件 / 436件

  • Actix web(1.0)でグローバルな状態を共有する方法

    試行錯誤を書いても役に立たないし色々な無駄な思考を書くのも面倒なので省いて短く書きます. まずActix web 1.0では0.7でstateと呼ばれていたものはdataと呼ばれるようになりました. dataのドキュメントは以下です. actix_web::web::Data - Rust そしてここに書かれているサンプルコードは間違っており, 素直に設定していくと App data is not configured, to configure use App::data().というエラーメッセージを見て困惑することになります. これはdataと型が一致しないことを示すエラーです. web::Data::newを使って型を合わせる方法はわかりません. 元コードでもあってる気がするんですが. というかそういうのはコンパイル時に弾いてほしい… 複数のdataを設定出来る(のか?)から仕方がな

      Actix web(1.0)でグローバルな状態を共有する方法
    • Why Rust should only have provided `expect` for turning errors into panics, and not also provided `unwrap`

      UPDATE 2: I have made the title longer because people seem to be insisting on misunderstanding me, giving examples where the only reasonable thing to do is to escalate an Err into a panic. Indeed, such situations exist. I am not advocating for panic-free code. I am advocating that expect should be used for those functions, and if a function is particularly prone to being called like that (e.g. Mut

      • Measuring Mutexes, Spinlocks and how Bad the Linux Scheduler Really is

        Measuring Mutexes, Spinlocks and how Bad the Linux Scheduler Really is by Malte Skarupke This blog post is one of those things that just blew up. From a tiny observation at work about odd behaviors of spinlocks I spent months trying to find good benchmarks, (still not entirely successful) writing my own spinlocks, mutexes and condition variables and even contributing a patch to the Linux kernel. T

          Measuring Mutexes, Spinlocks and how Bad the Linux Scheduler Really is
        • The borrow checker within · baby steps

          This blog is where I post up various half-baked ideas that I have. All PostsCategoriesGitHubTwitterRSS/Atom feeds This post lays out a 4-part roadmap for the borrow checker that I call “the borrow checker within”. These changes are meant to help Rust become a better version of itself, enabling patterns of code which feel like they fit within Rust’s spirit, but run afoul of the letter of its law. I

          • Designing a New Rust Class at Stanford: Safety in Systems Programming

            Writing quality software is hard. Sometimes, software breaks in entertaining ways. However, when software runs everything from personal assistants like Alexa and Google Home to banking to elections, some bugs can be much more severe. This past quarter, Armin Namavari and I tried teaching a class about how to write software that sucks just a little less. We focused on common problems in computer sy

            • Evolving the Go Standard Library with math/rand/v2 - The Go Programming Language

              The Go Blog Evolving the Go Standard Library with math/rand/v2 Russ Cox 1 May 2024 Since Go 1 was released in March 2012, changes to the standard library have been constrained by Go’s compatibility promise. Overall, compatibility has been a boon for Go users, providing a stable base for production systems, documentation, tutorials, books, and more. Over time, however, we’ve realized mistakes in th

                Evolving the Go Standard Library with math/rand/v2 - The Go Programming Language
              • MySQL(Replication Protocol)とElasticsearchのほぼリアルタイム連携の実現(リアルタイム・インデクシング) - Qiita

                MySQL(Replication Protocol)とElasticsearchのほぼリアルタイム連携の実現(リアルタイム・インデクシング)MySQLElasticsearchreplicationリアルタイムインデクシング 内容 ・リアルタイム検索、リアルタイム集計ができるようになる ・MySQLとElasticsearchをリアルタイムに近い時間で同期する方法 ・実際のコードはとても複雑なので考え方をダラダラと説明する ・ここでの説明が100%正しいとは思わないで 全体の流れ 変更の検知 MySqlが変更したことを検知するために「Replication Protocol」を使って疑似的なslave db(以下「dummy slave」とする)を構築する。 dummy slaveは以下の二つに分かれる ・masterからBinLogを受け取って検知した情報を保存する。(1プロセス)→R

                  MySQL(Replication Protocol)とElasticsearchのほぼリアルタイム連携の実現(リアルタイム・インデクシング) - Qiita
                • xv6にネットワーク機能を実装した : DSAS開発者の部屋

                  在宅勤務に移行してから1ヶ月半ほど経過しました。通勤という概念が消滅したおかげで午前中から活動できるようになった @pandax381 です。 要約 フルスクラッチで自作した TCP/IP プロトコルスタックを xv6 に組み込み、一通りの機能が動作するようになりました。 I publish the implementation of TCP/IP network stack on xv6. I ported my user-mode TCP/IP stack, which was originally developed for learning, and added the e1000 driver and socket system calls. Some parts are still not enough, but they are working.https://t.co/nh

                    xv6にネットワーク機能を実装した : DSAS開発者の部屋
                  • 週刊Railsウォッチ(20190902)Ruby 2.6.4セキュリティ修正リリース、スライド「All About Ruby in 2019」、Shrine gem 3.0に入る新機能ほか|TechRacho by BPS株式会社

                    2019.09.02 週刊Railsウォッチ(20190902)Ruby 2.6.4セキュリティ修正リリース、スライド「All About Ruby in 2019」、Shrine gem 3.0に入る新機能ほか こんにちは、hachi8833です。ついさっきruby-jp Slackのワークスペースアイコン↓が見ている目の前で突然変わってびっくりしました😳。おめでとうございます!🎉 その後ちょっぴりリサイズしたようです↓。 各記事冒頭には⚓でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のように)社内有志でつっついたときの会話の再構成です👄 毎月第一木曜日に「公開つっつき会」を開催しています: お気軽にご応募ください ※今回のウォッチは分割していません ※今回のつっつきはSlackベースで行いまし

                      週刊Railsウォッチ(20190902)Ruby 2.6.4セキュリティ修正リリース、スライド「All About Ruby in 2019」、Shrine gem 3.0に入る新機能ほか|TechRacho by BPS株式会社
                    • Gaussian Splattingを試す (Windows) – ft-lab

                      Gaussian Splattingは、SIGGRAPH 2023で発表されたプロジェクトです。 複数枚の写真からその空間のあらゆるところから見たビューを補間します。 同じ技術にNeRFがありますが、これの欠点を補った理論のようです(アルゴリズムはまだ未調査)。 NeRFの問題は、かなり大雑把な書き方ですが大きく以下の2点があります。 トレーニング時間がかかる 最終的な空間の復元で解像度不足 (なんだか眠い) GitHubのリポジトリはこちらになります。 https://github.com/graphdeco-inria/gaussian-splatting 今回はGaussian Splattingを試す流れをまとめることにしました。 CUDA11.8とAnaconda3を使います。 GoProで撮影した動画を使ってウォークスルーするまでを行います。 検証環境 OS : Windows

                      • fmtパッケージをインポートするとファイルサイズがどかんと増えてしまう理由 - Qiita

                        しかし、パッケージとしては以下のような依存が発生してしまっています。internalは抜きます。 errors go io os path reflect sort strconv sync syscall unicode time type Goはリンク時に不要な関数は削除してバイナリをなるべく小さくしようとするのですが、Goの言語仕様&エスケープ解析の欠点としてはinit()で参照(パッケージグローバル変数の宣言もコンパイル時に生成されるinit()にまとめられるので、グローバル変数宣言も)されたものはすべて、eliminationが働かずにリンクされちゃうんですよね。 %vでどんな型がきてもパースしてやるぜ、という機能があるのでおそらくそこでリフレクションをimportしていて、そのimportの中にinit()があれば、そこで使っている要素がシンボルとして残り・・・みたいな連鎖でし

                          fmtパッケージをインポートするとファイルサイズがどかんと増えてしまう理由 - Qiita
                        • Exploiting null-dereferences in the Linux kernel

                          Posted by Seth Jenkins, Project Zero For a fair amount of time, null-deref bugs were a highly exploitable kernel bug class. Back when the kernel was able to access userland memory without restriction, and userland programs were still able to map the zero page, there were many easy techniques for exploiting null-deref bugs. However with the introduction of modern exploit mitigations such as SMEP an

                            Exploiting null-dereferences in the Linux kernel
                          • Goによるロードテスト - DeNA Testing Blog

                            はじめに SWETグループGoチームの金子 (@theoden9014) です。 弊社が運営するライブコミュニケーションアプリであるPococha(ポコチャ)においてロードテストを実施する際、Go言語を利用して独自のロードテストツール開発しました。今回は、その知見を共有したいと思います。 この記事はDeNA Advent Calendar 2020の4日目の記事です。 本記事ではシステムをWebシステムと前提としていますのでご注意ください。 ロードテストとは (Load Testing) JSTQBやISTQBにおいては性能テスト (Performance Testing) の1つと定義されています。 性能テストとはシステムテストにおける非機能テストの1つです。 ロードテスト、耐久性テスト、ストレステスト等があり、それぞれ目的に応じて実施します。 ロードテストは、システムがユーザ負荷のピー

                              Goによるロードテスト - DeNA Testing Blog
                            • Linux Kernel ~ メモリ管理 スラブアロケータ編 ~ - レガシーガジェット研究所

                              Linux Kernelを無限に読む会 ~ メモリ管理 Ver 2 ~ 概要 「詳解Linux Kernel」を参考にVersion 2.6.11のコードリーディングをしていく。CPUのアーキテクチャは書籍に沿ってIntelのx86とする。 引き続きはメモリ管理について見ていく。 概要 メモリ割り当てには基本的な単位としてページフレームを採用しており、数十バイトや数百バイトのメモリ割り当ての場合には無駄が生じてしまう。代替案として単一のページフレーム内に小さなメモリ領域を複数割り当てられるようにした。 スラブアロケータ Solaris 2.4が初めて採用したスラブアロケータは以下のようなアルゴリズムで実装されている。 メモリ領域をデータ構造と関数を保持したオブジェクトとして扱い、オブジェクト毎にコンストラクタやデストラクタを保持する。初期処理の繰り返しを回避するため解放されたオブジェクトを

                                Linux Kernel ~ メモリ管理 スラブアロケータ編 ~ - レガシーガジェット研究所
                              • Rust Atomics and Locks by Mara Bos

                                About this Book The Rust programming language is extremely well suited for concurrency, and its ecosystem has many libraries that include lots of concurrent data structures, locks, and more. But implementing those structures correctly can be difficult. Even in the most well-used libraries, memory ordering bugs are not uncommon. In this practical book, Mara Bos, team lead of the Rust library team,

                                  Rust Atomics and Locks by Mara Bos
                                • Jepsen: etcd 3.4.3

                                  The etcd key-value store is a distributed database based on the Raft consensus algorithm. In our 2014 analysis, we found that etcd 0.4.1 exhibited stale reads by default. We returned to etcd, now at version 3.4.3, to investigate its safety properties in detail. We found that key-value operations appear to be strict serializable, and that watches deliver every change to a key in order. However, etc

                                  • Rust 1.63を早めに深掘り - あずんひの日

                                    こんにちは、あずんひ(@aznhe21)です。今月からあずんひの活動を支援できる仕組みを導入してみました。寄付頂ける方は記事末尾からお願いします。 さて、本日8/12(金)にRust 1.63がリリースされました。 この記事ではRust 1.63での変更点を詳しく紹介します。 8/12は最初の「PC」であるIBM 5150が発売された日 ピックアップ スコープ限定スレッドが使えるようになった 関数を使って配列を初期化できるようになった 各種ロック機構が定数文脈で生成できるようになった I/Oの生ハンドルが所有権に基づいて管理できるようになった 安定化されたAPIのドキュメント array::from_fn 引数 サンプル Box::into_pin メモ BinaryHeap::try_reserve エラー サンプル BinaryHeap::try_reserve_exact エラー サ

                                      Rust 1.63を早めに深掘り - あずんひの日
                                    • Writing FreeBSD Kernel Modules in Rust

                                      At present all major operating system kernels are written in C/C++, languages which provide no or minimal assistance in avoiding common security problems. Modern languages such as Rust provide better security guarantees by default and prevent many of the common classes of memory safety security bugs. In this post we will take a brief look at existing community efforts towards this goal and build a

                                        Writing FreeBSD Kernel Modules in Rust
                                      • Apache が AH00144 で落ちる件 - (ひ)メモ

                                        事象 Ubuntu 18.04 apache2 (2.4.29-1ubuntu4.12) で、apache2 プロセスが次のエラーメッセージを吐いて落ちるという連絡を受けて調べました。これはその原因と対処法のメモです。 [mpm_prefork:emerg] [pid 18633] (43)Identifier removed: AH00144: couldn't grab the accept mutex [mpm_prefork:emerg] [pid 18632] (43)Identifier removed: AH00144: couldn't grab the accept mutex [core:alert] [pid 18624] AH00050: Child 18632 returned a Fatal error... Apache is exiting! [:emerg

                                          Apache が AH00144 で落ちる件 - (ひ)メモ
                                        • Garbage Collection for Systems Programmers

                                          Let’s talk about one of the most performance-sensitive programs you run every day: your operating system. Since every speedup gives you more computer to compute with, an OS is never fast enough, so you can always find kernel and driver developers optimizing the bejesus out of their code. Operating systems also need to be massively concurrent. Not only is your OS scheduling all userspace processes

                                            Garbage Collection for Systems Programmers
                                          • BLE制御するC++製iOSアプリをPigeon使ってFlutterアプリ化した

                                            たまには自慢したい 企業に属する請負開発屋なので10年以上アプリ開発やっていても「そのアプリ実はコード書いてるの俺」と言うことはほとんどありません。そんな中、初版リリース時から「プログラマはdaisuke7」と書いちゃっても良い許可をいただいている貴重なアプリがあります。株式会社サンスターストロボ様の「SSScontrol for MONOSTAR C4(App Storeリンク)」。今回このアプリが刷新することになり、その開発担当として再びお誘いいただきました(感謝!)。アップデート版はすでに無事審査も通って公開されています。 さてこのアプリ、6年前の初版はCocos2d-xというゲームエンジンを使ってC++とObjective-Cでコードを書いていましたが、今回はエンジンをFlutterに改め、コードの半分以上をDartで書き直しました。同様のケースは滅多にないかもしれませんが、今回の

                                              BLE制御するC++製iOSアプリをPigeon使ってFlutterアプリ化した
                                            • Pythonで書いた分散KVSのシミュレータをRustに書き換えようとして苦労している話 - Qiita

                                              どうも ryo_grid です。5カ月強ぶりの投稿です。 今回は、Pythonで書いた分散KVSのシミュレータ(マルチスレッドなプログラム)をRustで書き換えようとして苦戦している話について書きます。 Contribution 作業のメモ書きとかを書くのはガイドライン違反らしいので、この記事が単純なその手のたぐいではなく、ソフトウェア開発の世界に Contribution をするものであることを最初に書いておきます。 他言語で書いたプログラムをRustにポーティングする場合の事例紹介である 他言語から来た者がRustでマルチスレッドなプログラムをRustで書く時のはまりポイントについて示し、ある程度、どのように書けば良いかの情報を提供する(最適解でない可能性は高い。どころか、まったく的外れの可能性も無くはない) 多言語からRustに入る時に、他言語で気楽にできていたことがRustだとそう

                                                Pythonで書いた分散KVSのシミュレータをRustに書き換えようとして苦労している話 - Qiita
                                              • mikutter 5.0.0 - mikutter blog

                                                できること、超人的。 2009年12月25日の開発開始から12周年となる本日、mikutter 5.0をリリースします。 mikutter 4.1からの主な変更は、以下の記事を参照してください。 mikutter.hatenablog.com Gtk3対応は、はっきりいって退屈なものでした。 だからこそ、貢献してくれた方々に心から敬意を表します。 iPhone 13対応 gtk3: タイムライン上ではスクロールバーを常に表示する thanks Shibafu Midorino delete apply Revert "gtk3: StatusBarが妙に大きいので小さくした refs #1532" thanks Shibafu Midorino ImageMenuItem.new メソッドで underscoreエスケープ不要を明示する thanks Izumi Tsutsui Timel

                                                  mikutter 5.0.0 - mikutter blog
                                                • Easy Mode Rust — Llogiq on stuff

                                                  This post is based on my RustNationUK ‘24 talk with the same title. I’ll link the talk video once the recording becomes generally available. Here are the slides though. Also, here’s the lyrics of the song I introduced the talk with (sung to the tune of Bob Dylan’s “The times, they are a-changin’”): Come gather Rustaceans wherever you roam and admit that our numbers have steadily grown. The communi

                                                  • Modular: Mojo vs. Rust: is Mojo 🔥 faster than Rust 🦀 ?

                                                    Mojo is built on the latest compiler technology in MLIR, an evolution of LLVM which Rust lowers to, and so it can be faster. It depends largely on the skill of the programmer and how far they're willing to go with optimizations. Mojo's goal as a language, is to meet Python developers where they are, and allow them to learn some new tricks to optimize their code to the performance limits of any har

                                                      Modular: Mojo vs. Rust: is Mojo 🔥 faster than Rust 🦀 ?
                                                    • ミューテックスとアトミック処理について

                                                      主にアトミック処理に関する質問です。 いくつか不明な点があります。 アトミック処理とミューテックスの違いについて確認しておきます。 mutex と atomic の違いは何か、どちらが良いか アトミック操作 アトミック操作の長所は、ロックに比べて比較的処理が速く、デッドロックやコンボイなどを回避できる点にあります。 短所は、限られた操作しか行うことができず、より複雑な操作を効率良く総合的に扱うには不十分なことです。 次に、ロックフリーについて・・・ C++ストラウストラップ氏の本の中では以下のようにあります。 ロックフリープログラミングは明示的なロックを使わずに並行プログラムを開発するためのの一連の技法だ。 明示的なロックの代わりに使うのが、小規模オブジェクトに対するデータ競合を防ぐための(ハードウェアが直接サポートする)基礎的な演算である。データ競合が発生しない基礎的な演算は、一般的にア

                                                        ミューテックスとアトミック処理について
                                                      • PythonのThread(並列処理)は速度改善効果がないので「concurrent.futures」を使う - SE_BOKUのまとめノート的ブログ

                                                        目次 PythonのThread(並列処理)は速度改善効果がないのか確認 シーケンシャル実行ケースの計測 PythonのThreadを使うケースの時間計測 Threadで速度改善しないのがPythonの仕様 Pythonの並列処理で速度向上できる方法と計測結果 PythonのThread(並列処理)は速度改善効果がないのか確認 PythonのThreadで並列性による速度改善効果を期待しても無駄だと教えてもらったので試してみました。 同じ重たい処理をシーケンシャルに実行するのと、PythonのThreadを使って並列処理するので、どのくらい速度があがるのか?を確認してみます。 シーケンシャル実行ケースの計測 シーケンシャルの処理です。 import time # 単に時間がかかるだけの処理 def killing_time(number): return_list = [] for i i

                                                          PythonのThread(並列処理)は速度改善効果がないので「concurrent.futures」を使う - SE_BOKUのまとめノート的ブログ
                                                        • SQLite3で同時書き込みしたい

                                                          書き込みが発生する暗黙的トランザクションも同様のロックが発生します。 ロック中の読み取りは、EXCLUSIVEロック中だけ他プロセスもリードアクセスができなくなります。これ以外のUNLOCKED 、SHARED 、RESERVED中はリードアクセス可能です。 PENDINGはSHAREDロック所有プロセスはリードアクセス可能です。新たなSHAREDロックは獲得できません。 同時読み込みをサポートする仕組みであることがわかります。ただEXCLUSIVEロック中は読み込みも失敗することに注意が必要です。 プログラム(PHP SQLIte3)に落とし込んで考えると以下のようなことがわかりました。 ・querySingle("select")、query("select")、prepare("select")等でSHAREDロックが発生する ・exec("insert")等でSHARED、RESE

                                                            SQLite3で同時書き込みしたい
                                                          • RubyKaigi2023で紹介された gvl-tracing を Webサーバで試してみた - coincheck tech blog

                                                            はじめに こんにちは、トレーディングシステム開発運用部の宮下です。今回初めて RubyKaigi2023 に参加しました。 このブログでは、個人的に一番おもしろかったセッション Understanding the Ruby Global VM Lock by observing it について実際にコードを動かして深掘っていこうと思います。 セッションについて 今回ご紹介するセッションは Datadog の Ivo Anjo さんのセッションとなります。 Ruby には 以下のような機能を提供するために Global VM Lock(以下 GVL) という機構が存在します。 Mutex ConditionVariable Queue, SizedQueue concurrent-ruby gem … GVL は、Ruby のパフォーマンスに影響を与えるものらしいです。 このセッションでは、

                                                              RubyKaigi2023で紹介された gvl-tracing を Webサーバで試してみた - coincheck tech blog
                                                            • Ruby 3.3.0-preview3 リリース

                                                              Ruby 3.3.0-preview3 が公開されました。Ruby 3.3ではPrismという新しいパーサーの追加、新しいパーサージェネレーターであるLramaによるBisonの置き換え、RJITという新たなJITの仕組みを追加、YJITの高速化など様々な改善が行われています。 Prism Introduced the Prism parser as a default gem Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language Prism is production ready and actively maintained, you can use it in place of Ripper There is extensive docu

                                                              • How does Go calculate len()..?

                                                                The impetus for this post was a question on the Gophers Slack a while back. A fellow developer wanted to know where to find more information on len. I want to know how the len func gets called. People chimed in quickly with a correct answer It doesn’t. Len is compiler magic, not an actual function call. … all the types len works on have the same header format, the compiler just treats the object l

                                                                • taskset と cgroup は何が違うのか

                                                                  taskset と cgroupは、あるプロセスが利用可能な CPU コアを制限できる技術。どんな違いがあるのかを調べた。なお、本記事の cgroup は cgroup v1 のこと。 taskset は sched_setaffinity システムコールを利用したコマンドラインツール。sched_setaffinity はユーザが実行したプロセスの CPU Affinity をユーザの権限で変えられる。プロセスからは CPU が存在するけど自発的に使わない状態。(≒このコアじゃないとヤダ!)cgroup は CPU/メモリなどのリソースを隔離するための仕組み。cgroup は設定権限をファイルのパーミッションで管理し、ユーザからの操作を禁止できる。プロセスからは CPU が存在しない状態。(≒このコアだけ使ってね)sched_setaffinity と cgroup はユーザへのインタフ

                                                                    taskset と cgroup は何が違うのか
                                                                  • An introduction to lockless algorithms [LWN.net]

                                                                    Please consider subscribing to LWNSubscriptions are the lifeblood of LWN.net. If you appreciate this content and would like to see more of it, your subscription will help to ensure that LWN continues to thrive. Please visit this page to join up and keep LWN on the net. Lockless algorithms are of interest for the Linux kernel when traditional locking primitives either cannot be used or are not perf

                                                                    • 並行・並列プログラミングと同期・排他制御とイミュータブル性の話〜その2「スレッドと同期・排他制御」 - Qiita

                                                                      大学の授業で講義資料を作ったので,Qiitaにも展開しておきます. この記事シリーズでは,並行・並列プログラミングについて,要(かなめ)となる同期・排他制御の役割をCとJavaを例に簡単なプログラム例を示します.次に同期・排他制御の問題点をCのプログラム例とともに示します.そしてElixir(エリクサー)によって実現されている,全てをイミュータブルにすることによる利点について示します. シリーズ 並行・並列プログラミングと同期・排他制御とイミュータブル性の話〜その1「背景: クロック周波数の停滞とコア数の増加」 並行・並列プログラミングと同期・排他制御とイミュータブル性の話〜その2「スレッドと同期・排他制御」(本記事) 並行・並列プログラミングと同期・排他制御とイミュータブル性の話〜その3「同期・排他制御の2つの問題点」 並行・並列プログラミングと同期・排他制御とイミュータブル性の話〜その

                                                                        並行・並列プログラミングと同期・排他制御とイミュータブル性の話〜その2「スレッドと同期・排他制御」 - Qiita
                                                                      • etcdを使った分散ロック - Carpe Diem

                                                                        概要 前回のRedisを使った分散ロックでは、正確なロックを取るためにはZookeeperやetcdを使うと良い、とまとめていました。 なので今回はetcdを用いて分散ロックを実現します。 環境 etcd v3.4.15 pkg.go.dev/go.etcd.io/etcd v3.5.0 go 1.16.0 事前知識 分散ロックに必要なもの 分散ロックマネージャには以下の機能が必要です。 自動リース機能 CAS フェンシングトークンを発行する機能 1つ1つ説明していきます。 自動リース機能 ロックを取得したクライアントが何らかの要因で落ちた時、そのロックが解放されないままだと他のクライアントは永遠にロックを取得することができません。 したがって、ロックを取得したとしても、自動的に解放されるようTTLを付ける必要があります。 またこのTTLの管理はクライアント側でなく分散ロックを提供する側の

                                                                          etcdを使った分散ロック - Carpe Diem
                                                                        • Mutex without lock, Queue without push: cancel safety in lilos - Cliffle

                                                                          2023-07-10 (updated 2023-07-12) Levels of cancel safety What good is a queue that you can’t push into? What good is a mutex you can’t lock? Toward a more cancel-safe world I’m trying to do something kind of unusual with lilos: in addition to almost all the APIs being safe-in-the-Rust sense, I’m also attempting to create an entire system API that is cancel-safe. I’ve written a lot about Rust’s asyn

                                                                          • Rustでモックオブジェクトを自作してみる - Uzabase for Engineers

                                                                            こんにちは、SaaS Product Team の Ryo33 です。 この記事では Rust でモックオブジェクトを作ることを通してRefCellやMutex、Rc、Arcの使い方やSendやSyncについて学びます。 この記事を読むことで Rust でモックオブジェクトを自作できるようになります。 サンプルプログラム テストを書いてみる モックオブジェクトをつくる RefCell 非同期 複数の所有権 最後に 参考文献 サンプルプログラム まず書いていきたいコードとして以下のようなcreate_user_with_nameというユースケースを考えます。 もし、名前が空文字でなければUserPort.storeを呼ぶというコードです。 #[derive(PartialEq, Eq, Debug, Clone)] pub struct Name(pub String); impl Name

                                                                              Rustでモックオブジェクトを自作してみる - Uzabase for Engineers
                                                                            • Server Configuration | Vault | HashiCorp Developer

                                                                              Outside of development mode, Vault servers are configured using a file. The format of this file is HCL or JSON. Enabling the file permissions check via the environment variable VAULT_ENABLE_FILE_PERMISSIONS_CHECK allows Vault to check if the config directory and files are owned by the user running Vault. It also checks if there are no write or execute permissions for group or others. Vault allows

                                                                                Server Configuration | Vault | HashiCorp Developer
                                                                              • The Dragon Who Sold His Camaro: Analyzing Custom Router Implant - Check Point Research

                                                                                The Dragon Who Sold His Camaro: Analyzing Custom Router Implant Research by: Itay Cohen, Radoslaw Madej, and the Threat Intelligence Team Over the past few months, Check Point Research has closely monitored a series of targeted attacks aimed at European foreign affairs entities. These campaigns have been linked to a Chinese state-sponsored APT group we track as Camaro Dragon, which shares similari

                                                                                  The Dragon Who Sold His Camaro: Analyzing Custom Router Implant - Check Point Research
                                                                                • スレッドは join しなくてもよい | 冷たき沢の岩陰の

                                                                                  この記事は Rust Advent Calendar 2023 22日目の記事です. TL;DR std::thread::JoinHanlde<T> は join() しないとメモリリークすると思い込んでいたがそんなことはなかったな! 問題 Rust はメモリ安全・スレッド安全な言語であることを標榜しており, 多くの場合は安全でないことをしようとするとコンパイルが通りません. 例えば複数のスレッドからあるオブジェクトに対して可変参照 &mut T を通じて変更をすることはできず, 例えば Arc<Mutex<T>> などを利用する必要があります. 一方で安全な (unsafe でない) 操作のみを使っていても防げないものもあります. 典型的なものはメモリリークです. 例えば Rc を使って循環参照を作ってその部分を切り離すと, 切り離された側は永遠に drop されません. (参照カウン