| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
- 자바스크립트
- reference counting
- Lock-free Stack
- JavaScript
- ccw 알고리즘
- 최소 공통 조상
- trie
- Github
- Delete
- localstorage
- DP
- 트라이
- Strongly Connected Component
- Spin Lock
- 그래프 탐색
- 비트마스킹
- 강한 연결 요소
- Express.js
- SCC
- 게임 서버 아키텍처
- Behavior Design Pattern
- 이분 탐색
- Binary Lifting
- R 그래프
- 벨만-포드
- PROJECT
- 비트필드를 이용한 dp
- 2-SAT
- map
- Prisma
- Today
- Total
목록reference counting (2)
dh_0e
GameServer.cppclass Wraith{public: int _hp = 150; int _posX = 0; int _posY = 0;private:};class Missile{public: void SetTarget(Wraith* target) { _target = target; } void Update() { int posX = _target->_posX; int posY = _target->_posY; // TODO : 타겟을 쫓아감 }private: Wraith* _target = nullptr;};int main(){ Wraith* wraith = new Wraith(); Missile* missile = new Missile(); missile->SetTarget(wraith);..
Lock-Free Stack with Smart PointerGarbage Collector의 기능을 스마트 포인터로 대체하는 방법사실 스마트 포인터가 내부적으로 lock을 사용하기 때문에 엄밀히 말해서 Lock-Free 방식은 아님shared_ptr ptr;atomic_is_lock_free(&ptr); 로 CPU가 lock을 사용하는지 검사해 보면 false 나옴templateclass LockFreeStack{ struct Node { Node(const T& value) : data(make_shared(value)), next(nullptr) {} shared_ptr data; shared_ptr next; };public: void Push(const T& value) { shared_..
