C
read THOR(CSV file) · GitHub[2019-03-09] もはやなんの目的で作ったのかも忘れてしまった謎コード。 THORってなんだったっけ?
http://www.artima.com/articles/io_design_patterns.html私がやろうとしているのは、まさにこのProactor Emulationと呼ばれるものです。そして今悩んでいるのは、Proactor jobのスケジューリング。
$ cat hoge.c #include <stdio.h> int main(void) { char $str[] = "hello"; printf("%s\n", $str); return 0; } $ gcc -Wall -W hoge.c $ ./a.out hello $ gcc -pedantic hoge.c hoge.c:5:7: warning: '$' in identifier or number $</stdio.h>
手っ取り早く、手ぬきで実装するとこんな感じになります。 他のマシンで実行したい場合は、jmp_bufの中身をよく観察して、適切なインデックスに突っ込めば、大抵OKです。 #include <stdio.h> #include <stdlib.h> #include <setjmp.h> typedef struct co { void (*proc)(void); jmp_buf jb</setjmp.h></stdlib.h></stdio.h>…