C++ Multithreading Programming
Thread Disk에 저장되어 실행가능한 파일로 되어 있는 것을 프로그램이라 하며, 해당 프로그램이 운영체제로부터 자원(CPU, Virtual memory…)을 할당 받아 실행 중인 동적인 객체를 프로세스라 한다. 프로세스가 수행되려면 자원(Resource)와 수행 흐름(Flow of...
C++ Custom exception handling
Custom exception handling 1. Make custom exception class According to std exception custom exception class inherit from std::exception like below. // exception.hxx class Exception : public std::exception { public: Exception(int...
Implement 'ls', 'cat' using c++ on linux
#include <cstdio> #include <sched.h> #include <iostream> #include <string> #include <memory> std::string ls(const char *path) { using FilePtr = std::unique_ptr<FILE, decltype(&::pclose)>; std::string cmd("/bin/ls "); cmd.append(path); FilePtr ls(::popen(cmd.c_str(), "r"), ::pclose); if (ls...
Setting tensorflow using docker on mac OS
Environment Setting 1. Install docker for mac. Pull tensorflow image. $ docker pull tensorflow/tensorflow 3-1. Launch a docker container that contains one of the tensorflow images. $ docker run -it...
systemcall EINTR handling
시스템 호출 system call 시스템 호출(system call)은 운영 체제의 커널이 제공하는 서비스에 대해, 응용 프로그램의 요청에 따라 커널에 접근하기 위한 인터페이스. 시스템 호출이란 프로그래밍 언어에서 지원하지 않는 기능에 대하여 운영...