-
June 4th, 2010, 11:54 AM
#1
Threading in c
Hi,
I'm trying to create some threads in c and I got an example code.
It says I have to include the file thread.h, however the compiler says it cannot find the file.
How can I solve this?
Thanks.
-
June 4th, 2010, 11:59 AM
#2
Re: Threading in c
Which threading library are you using? C doesn't have a standard threading library, but pthreads is a commonly-used one. The only one I can find offhand which has a "thread.h" is Solaris threads, which is similar but less commonly supported.
C++ does define standard threads in the newest standard, but I don't think any compilers actually support that yet.
-
June 4th, 2010, 12:08 PM
#3
Re: Threading in c
Is there a windows-based library that I can use?
-
June 4th, 2010, 12:11 PM
#4
Re: Threading in c
Yes, but in my opinion it offers few advantages over the cross-platform options.
-
June 4th, 2010, 12:16 PM
#5
Re: Threading in c
What kind of library is needed? Native calls like CreateThread and _beginthreadex let you deal with threads without dependency on any library. In Windows, of course.
Last edited by Igor Vartanov; June 4th, 2010 at 12:22 PM.
Best regards,
Igor
-
June 4th, 2010, 12:18 PM
#6
Re: Threading in c
Originally Posted by dragonuv
Is there a windows-based library that I can use?
_beginthread, _beginthreadex
_endthread, _endthreadex
Victor Nijegorodov
-
June 4th, 2010, 12:41 PM
#7
Re: Threading in c
Originally Posted by Igor Vartanov
What kind of library is needed? Native calls like CreateThread and _beginthreadex let you deal with threads without dependency on any library. In Windows, of course.
Just to be pedantic, I'd say that the Windows Platform SDK qualifies as a library.
-
June 5th, 2010, 12:49 AM
#8
Re: Threading in c
To be pedantic the same way, I cannot fully agree with this. Development Kit is not equal to Library. In some aspects it's more than a library been rather a bunch of specific libraries. But in others it's less.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|