C Programming in Linux Tutorial using GCC compiler. Tutorial should also be applicable in C/UNIX programming. An example on how to create threads using the POSIX threads, or pthreads.
Amazon Auto Links: No products found.
C Programming in Linux Tutorial using GCC compiler. Tutorial should also be applicable in C/UNIX programming. An example on how to create threads using the POSIX threads, or pthreads.
Amazon Auto Links: No products found.
Author: ShellWave
Thanks man this helped me in my assignment!
In my this is first printing for thread 2 and then thread 1
How can char store string value? In my program can’t work correct I don’t know how to deal with it
nice
This is so interesting. Way to go!!
Thanks.
Does the threads print the two printf statements after pthread_join?
I see no ret1 = or ret 2 = in the output
it’s great!!
btw how to copy a similar line that fast?
like 2:58
any hot key in vi?
thanks(:
mr Mackey is that you ?
Finally a clear explanation with multiple threads running. Thanks for uploading
einfach toll
Bad code but nice tutorial to look at what code we can expect to need.
You don’t have to (and shouldn’t, honestly) cast ‘myvar’ to ‘(char *)’ because void pointers are safely and automatically promoted to any other pointer type. You actually don’t even need the ‘msg’ variable at all; you can just as easily do `printf(“%s %dn”, (char *)myvar, i);`. You also should _always_ be compiling with ‘-Wall’ and ‘-Wextra’, because if you did you would see that you are not properly including the header file for ‘sleep()’. ‘sleep()’ is declared in ‘‘, not ‘‘. Also, you should use the gcc option ‘-pthread’ for pthread support (or the synonymous ‘-pthreads’) rather than ‘-lpthread’, it does more than link the library (check the gcc man page if you’re interested in the specifics), it does everything necessary to get you full pthread functionality (and even just looking at the man page you have open in this vid. for ‘pthread_create’, it says to compile & link with ‘-pthread’; it doesn’t mention ‘-lpthread’). Other than that, good video, thanks :).
Are you a professional programmer? Great skills, thanks for tutorial.
great vid, thanks!
Thanks for the tutorial !
Thanks, very helpful and clear explanation! 🙂