Programming

Parenj, Paren#이 이제 thread를 지원합니다.

steloflute 2014. 4. 14. 20:13
Parenj 1.8.1과 Paren# 0.2.1에서 간단하게 thread(쓰레드 생성)와 join(쓰레드 종료를 기다림)를 지원합니다.
 
 
예제:
> (set t1 (thread (for i 1 10 1 (pr "" i)))) (set t2 (thread (for j 11 20 1 (pr "" j)))) (join t1) (join t2)
1 11 2 12 3 4 5 136 7 8 9 1014 15 16 17 18 19 20 : null
 
요즘 느끼는 건.. "CPU가 변하면 프로그래밍 언어도 변해야 한다."입니다. 예전 C나 C++이 처음 나왔을 때는 컴퓨터 아키텍처 자체에 thread 개념이 없어서 thread를 라이브러리 형태로 사용하던 것이 C++11에서는 언어에 포함되었다고 합니다. 늦었지만 올바른 방향인 것 같습니다.
 
(pthread보다는 쓰기 쉬워 보이네요.) pthread 예제 | http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
 
p.s. Paren(C++버전)의 thread 지원은 준비중에 있습니다.

 

Update 2014-04-15

Paren(C++ 버전) 1.7.2에서 thread 지원

Paren | https://bitbucket.org/ktg/paren

 

 

'Programming' 카테고리의 다른 글

(Emacs) cider 설치  (0) 2014.04.23
(C#) MD5 hash  (0) 2014.04.17
[C++] Thread(쓰레드, 스레드)  (0) 2014.04.13
(Go) channel  (0) 2014.04.13
(Go) interface{}  (0) 2014.04.10