Where can I learn more about pthreads? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am asked to work on a piece of code which relies heavily on pthreads. So many calls are made to this library that I know nothing of. I have learnt the basics of pthread and have tried out a few examples like creating joining etc. but dont know the depths of it.
I have learnt much of it using http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
The above tutorial doesn't inlcude an indepth coverage of the pthread library that a beginner should need. Could u guys recommend a website or an eBook for me to have a look and learn most of the advanced stuff like signal handling, mutexes, concurrency etc.
TIA,
the_Saint

https://hpc-tutorials.llnl.gov/posix/
http://en.wikipedia.org/wiki/POSIX_Threads
[EDIT] First link was broken, now is fixed.

Check out "Programming with POSIX threads" by Butenhof
(eg. here)

The best way to learn about any programing concepts is to go through the examples like to solve some problems using pthreads like Producer & consumer, Reader/writer problems and implement simple mathematics calculator etc.
there is some links which may help you,
http://www.humbug.org.au/talks/pthreads/examples.html,
http://www.cs.ucsb.edu/~tyang/class/pthreads/index_sgi.html
There is also one book "Advanced Programming in the UNIX® Environment: Second Edition
By W. Richard Stevens, Stephen A. Rago"
All the Best!

As Ankit S states above, Advanced Programming in the Unix Environment is a good source. Also, volume 2 of Unix Network Programming (also by Stevens) has a big section on posix semaphores and similar topics.

http://randu.org/tutorials/threads/
http://www.ibm.com/developerworks/linux/library/l-posix1/index.html
http://www.cs.cf.ac.uk/Dave/C/node32.html
You can read a lot at stackoverflow:
https://stackoverflow.com/questions/tagged/pthreads+c

Related

Problems to practice programming under linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have started using/learning linux few days back. I am reading the book "Advanced Linux Programming". It is a very nice book but it does not contain exercises to practice.
I am not able to make problems on my own.
Can you please share a link or a book where I can get problems to practice C/C++ under Linux?
EDIT: I was looking for problems related to multithreading,interprocess communication and synchronization.
I know C and C++. I have been working on windows and now I want to learn Linux.
thanks
http://www.doc.ic.ac.uk/~wjk/C++Intro/RobMillerE1.html
http://en.wikibooks.org/wiki/C++_Programming/Exercises/Iterations
http://www.cprogramming.com/challenge.html
Hope this is what you are looking for.
Several books have exercises at the end of each chapter. Most which have been recommended on StackOverflow do. There are also challenges and exercises online, but I think it is for the intermediates.
Btw googling "c++ programming exercises beginners" give tons of results, even the one Nader mentionned. Also check out codechef easy section

Good introduction to OpenGL? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm interested in learning about rendering and "the whole 2D/3D stuff", especially in OpenGL/C#. There are thousands of search results on Google, so I was wondering if you have any recommendations which to pick, and how to approach the issue - is it possible to become proficient without a teacher? - Are there great books on the topic?
My background: I have been programming in C++/Java/C# for years. I got basic math skills but lack knowledge once it comes to basic university level. The reason for digging into this topic is a company project as well as personal interest.
If you're going to use OpenGL in C#, go for OpenTK which is an amazing C# library that let's you use everything OpenGL, OpenAL and OpenCL have to offer from a typesafe .NET environment. Their website has very good tutorials as well. Once that is done, you can usually choose OpenGL tutorials and translate them to OpenTK syntax without much trouble. NeHe has very good OpenGL tutorials. Good luck!
I recommend the OpenGL Super Bible 5th Edition too. It's got all the new shader stuff (though the code examples are all in C++).
the red book is very good.
http://www.opengl.org/documentation/red_book/
i'd say it is the only book you need to get started

i need a good website to learn c++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
i want to learn C++; and i already have a compiler.
i already know a few programming languages including:
BASIC (yes, the dos version)
visualBasic (using VisualBasic Express
2006 or 8 i'm not quite sure)
Java
PHP
HTML (if we count that)
so it doesn't need to be for absolute beginners; although if you find one post it too.
www.cplusplus.com is a great website with tons of documentation for experts and beginners.
Tutorials for beginners:
http://www.cplusplus.com/doc/tutorial/
An additional website I heartily reccomend once you have a little more expertise is the C++ FAQ Lite.
The text of a good book is online here: Thinking in C++
G'day,
I know it isn't a website but I'd highly recommend working through the excellent book Accelerated C++ (sanitised Amazon link) by Andy Koenig and Barbara Moo.
It'll start you off properly by approaching C++ as it's own language rather than C with OO bits "bolted on". And you get to work with STL right from the start.
Highly recommended.
HTH
cheers,
It's not a tutorial per-se but the C++ FAQ LITE is an invaluable resource IMHO.
I would like to highlight a website for C++ programming.
Learn C++ Online - www.learncpponline.com
The above website is still not completely updated I think. But this website helped me a lot in my studies. Hope it will be helpful for others as well
Aprt from the useful links given by #Doug T. You can have a look at the advanced puzzles of c++ # http://www.gotw.ca/gotw/ ( of course after the basics)
I second Rob Wells; "Accelerated C++" is an excellent book. It would be hard to do better.
I would like to add that pointers can be especially daunting coming from your background. One of the best explanations I have come across is here at the Stanford CS web site. They have several pdfs and even an animated video on the subject.

Learning C++ Language [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am a .net c# programmer but I want to learn .NET C++ also. I am a beginner for c++. Is there any site, book, or Video Tutorials from beginner to expert?
There's no such thing as ".Net c++".
Maybe you mean C++/CLI, which is Microsoft's language specification intended to supersede Managed Extensions for C++ (See Wikipedia). Managed extensions to C++ are its inferior and now defunct ancestor [thanks #dp for your comment].
Bear in mind when you choose your learning material that C++/CLI is not equal to the (standard) C++ programming language; so if you want to learn the former, you should edit the question title and tags.
(Note: This is not to be nitpicky, but to help. I think getting the right idea for each name, and the right name for each concept, is an important factor for consistent learning. And of course it's especially important if you search for information on the web.)
I'd suggest starting with Bruce Eckel's Thinking in C++ for a start.
It's already around for some time (latest version 2003) but it provides a good path from beginner to the more advanced techniques and interiors of C++. It has also some OO foundations in case you like to want to know more about that basics.
(Master download site for the book)
cprogramming.com
cplusplus.com
For a beginner I think a good starting place is C++ Primer. From there I'd recommend Scott Meyers' Effective C++ books.
Certainly this has been asked before, I just can't find the duplicate.
http://www.amazon.co.uk/Accelerated-Practical-Programming-Example-Depth/dp/020170353X/ref=sr_1_4?ie=UTF8&s=books&qid=1235080299&sr=1-4
is great for c++, you'll know the .net from your c#
The biggest tip: in C# you'd do everything with classes, and in C++, you do anything to do with the Win32 API with function calls.
google.com and msdn.microsoft.com are your friends.
Never give up. C++ is much more time-consuming to write, and it's easier to make mistakes.
As you are writing your programs, look for small examples that do small pieces of what you want to achieve, and study them.

Are there any good beginner tutorials for threads in windows? C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Looking for a good site or book that explains windows threads, preferably for a beginner. Maybe has a example program to run, etc....
You want Chapter 20 of Programming Windows by Charles Petzold "Multitasking and Multithreading".
It also covers related things like synchronization, and events.
This book is a classic, and probably one of the best ways to get a very good understanding of how Windows Win32 programming works with C++.
Otherwise you can start on this MSDN pages for CreateThread.
For a more portable solution, boost threads are another way to go as well. Combined with boost::bind and several boost synchronization objects, it makes for a very powerful threading library.