0

**

is it possible to creat threads in c-programming?

**

Sub-Heading Here

yes,then how?
no, then why not?

Edited by Shashank clic

5
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by nmaillet
0

Yes, but it's not built in to the language or standard libraries. You'll need to use a third-party library to create and manage threads. For Windows, you can use the WinAPI; here is the Process and Thread Reference.

Edited by nmaillet

0

You can crate thread

int pthread_create(pthread_t * pth, pthread_attr_t att, void * (function), void * arg);

0

In order to use pthread_create() you will need to include <pthread.h>. Note that <pthread.h> is available only for POSIX systems.

1

Yes, but it's not built in to the language or standard libraries.

Actually, it is as of C11. Though the trick with the latest standard is finding an implementation of it. Hopefully C11 will be more widely adopted than C99. ;)

0

Actually, it is as of C11.

Oh cool, I haven't followed the new C/C++ standards for a couple years. Nice to see them updating the standards, but, as you said, we'll see about the adoption. Thanks for the info.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.