JP: 熊崎 宏樹 EN: Kumazaki Hiroki
search, Google
#include <memory.h> | |
#define _XOPEN_SOURCE_EXTENDED 1 | |
#include <sys/mman.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <climits> | |
#include <algorithm> | |
int main() { |
Copyright 2023 Hiroki Kumazaki | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O |
Copyright 2023 Hiroki Kumazaki | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O |
wait-free/lock-free/obstruction-freeの定義について | |
▲全てに共通する概念 | |
スレッドが他のスレッドの進行を禁止する事がないので、どれかのスレッドが | |
ロックを確保したままプリエンプションなどで全体の処理が停止する事態が発生しな | |
い。 | |
これは必ずしもロックベースのアルゴリズムより高速であることを意味し | |
ない(現にロックの方が早い場合もある | |
wait-freeが一番強い条件で、それを弱める度に |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
class BIT { | |
public: | |
explicit BIT(size_t n) : tree(n + 2) {} |
package main | |
import ( | |
"log" | |
"time" | |
"image/color" | |
"golang.org/x/image/font" | |
"golang.org/x/image/font/opentype" | |
"math/rand" |
lld/build$ cmake -G Ninja .. | |
CMake Error at CMakeLists.txt:6 (string): | |
string sub-command REGEX, mode MATCH needs at least 5 arguments total to | |
command. | |
-- LLD version: | |
CMake Error at CMakeLists.txt:10 (string): | |
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to | |
command. |
#ifndef LOCKFREE_QUEUE | |
#define LOCKFREE_QUEUE | |
#include "atomics.h" | |
#include <unistd.h> // usleep | |
#include <stdlib.h> // rand | |
namespace lockfree{ | |
template<typename T> |