Hi guys, I use FreeBSD OS and the C programming language (just C - not C++). I need to create a few threads in my C program. But I don't know how.
Some time ago, I worked in Windows and used Borlan Builder Compilator (used just C++ - not C). But I don't like Windows, C++ and now I using just ANSI C and FreeBSD, and I have many questions.
Okay, one year ago the world was shocked standardization C11 (ISO/IEC 9899:2011). This standard has header files: threads.h
and some functions:
call_once()
cnd_broadcast()
cnd_destroy()
cnd_int()
cnd_signal
... and others
It is very good. But a little problem - where to get the compiler? In FreeBSD ports I found lang/gcc47. Installed it and read man:
So, I see: "Support is incomplete and experimental. " - it is bad
Okay, I think that I can use c99 standard for my idea. But how? I found the "POSIX Thread library" - what do you think, that is a good idea? What is your recommendation for me? How do you deal with multithreading? Show me examples, please, or say what I should have read?
Cry: Help me guys, thank you all!
Some time ago, I worked in Windows and used Borlan Builder Compilator (used just C++ - not C). But I don't like Windows, C++ and now I using just ANSI C and FreeBSD, and I have many questions.
Okay, one year ago the world was shocked standardization C11 (ISO/IEC 9899:2011). This standard has header files: threads.h
and some functions:
call_once()
cnd_broadcast()
cnd_destroy()
cnd_int()
cnd_signal
... and others
It is very good. But a little problem - where to get the compiler? In FreeBSD ports I found lang/gcc47. Installed it and read man:
Code:
-std=
Determine the language standard. This option is currently
only supported when compiling C or C++.
....
c11
c1x
iso9899:2011
ISO C11, the 2011 revision of the ISO C standard. Support
is incomplete and experimental. The name c1x is deprecated.
So, I see: "Support is incomplete and experimental. " - it is bad
Okay, I think that I can use c99 standard for my idea. But how? I found the "POSIX Thread library" - what do you think, that is a good idea? What is your recommendation for me? How do you deal with multithreading? Show me examples, please, or say what I should have read?
Cry: Help me guys, thank you all!