C

C sample code for reading #THOR CSV file.[from G+ 2014-02-13]

C

read THOR(CSV file) · GitHub[2019-03-09] もはやなんの目的で作ったのかも忘れてしまった謎コード。 THORってなんだったっけ?

Proactor Pattern

C

http://www.artima.com/articles/io_design_patterns.html私がやろうとしているのは、まさにこのProactor Emulationと呼ばれるものです。そして今悩んでいるのは、Proactor jobのスケジューリング。

$

C

$ 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>

セミコルーチンの実装(x86 only)

C

手っ取り早く、手ぬきで実装するとこんな感じになります。 他のマシンで実行したい場合は、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>…