Introduction To Threads (pthreads) | C Programming Tutorial

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

I just learned about threads about 4 days ago. You can’t believe how much better a 13+ min video is than my 1 hour lecture in explaining threads.

Shadowll
Автор

There are very few tutorials on this topic. Thank you for your work!

dianafarhat
Автор

You are better than my professor in terms of explaining things. Thank you !!!

hengyili
Автор

You know what!! This is better than hours of lectures. So crisp and to the damn point! 👏👏👏👏

Now I can start reading other references.

Thanks for the video.

safarmaihoon
Автор

13mins video is more valuable than 2 hours lecture on my university :D

atchau
Автор

We're studying this at university right now and I have to say this is very much useful. It's almost clear after the first watch only.

mansbjork
Автор

Just wanted to say that I found your channel today and you have done some amazing work on your channel

ButteryCowEgg
Автор

You Sir are an angel, I've been stuck trying to understand how to use threads in C for SOOOO LONG and this tutorial makes so much sense, i was actually able to code along and it works and i get it ! AAAAH I'm so relieved, it finally makes sense, THANK YOU SO MUCH !

cptmnxl
Автор

They way you explains with examples...Marvelous sir

GeneTechAgency
Автор

something that I particularly liked is .. the comparison you do at the end, this shows how useful multi-threading is

alvarobarboza
Автор

best ASCII presentation I've seen so far.

p_molnar
Автор

I am listing this channel as a reference in my school project because I have learned a ton of c from here. Thank you!

theyayaa
Автор

Defined greatly n precisely ✨ best single shortest video to learn whole fkn threads topic …

emmadhamid
Автор

I've been playing around with OpenMP in VS and it works great for optimizing loops for parallel execution, where the threads seem to execute in random order each time the program is run. However, after looking at the documentation a little more attentively, there are a number of command parameters associated with the pragmas that would make life easier rather than trying to play around delay loops, ordering and placements. Great intro to threading.

Mtlik
Автор

wanted to say that you've done some amazing work on your channel

AibekDandaev
Автор

You can also get the return value, you just have to pass a pointer to the place where the return value of the function will be put at (the result is also statically a void pointer!) as the second parameter to pthread_join():

void* add(void* param) {
long* result = (long*)malloc(sizeof(long));
*result = *(long*)param + 1;
return result;
}
int main() {
pthread_t thread1;
long value = 10;
pthread_create(&thread1, NULL, &add, &value);
long* result;
pthread_join(thread1, (void**)&result); // output pointer to a `long` pointer!
printf("result: %ld\n", *result); // 11
free(result);
return 0;
}

HuntingKingYT
Автор

I think i have clear understanding about pthreads post watching this video....thanks for the free tuts.

adityak
Автор

Multithreading it’s not about executing multiple instructions at the same time. It’s about sharing resource beetween them.

OdinRues
Автор

Really thank you for this great explanation

raffayylsamuill
Автор

For some of us, we also have to add a flag to the linker: -lpthread.

baruchben-david