Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am new comer to linux programing.I need to run a multithreaded application which will read and write data to 7 UART ports.
for each UART port there will be 2 deidcated threads (i.e. read and write threads).I have a c++ code which creates thread to read and write data to any particualr UART port.But i want to run all the 7 ports parallel.Plese help me to know how i need to modify the below code so that it can create 7 write and read threads for 7 UART ports and could simultaneoulsy read/write from/to all the ports.
Thank u so much in advance.
Please use [code][/code]] tags to enclose your code. There are instructions in the LQ FAQ as well as instructions in one of my signature links. Or just observe the advanced edit mode tools to see how to do that.
I'm not sure you need threads, I do a lot of multiple serial receive and transmit with either multiple processes or just one process and the needed file descriptors per serial interface.
How fast are the serial connections?
Is the data coming in continuously, or not?
What do you need to do with the data when received? Plot? Save? Retransmit? Decode and act upon?
When you next post code I recommend that you do the following:
Post complete code sections which compile. The code you've posted has far too many errors, undefined values, unresolved definitions
Separate the chunks. You have one section that is your main and then your intended receive and transmit functions. For me it's clearly more helpful to see the code, but also be informed that a particular section has been tested, debugged, and is not considered to be your problem.
You can consider viewing my blog entries on select(), and one on a USB serial receive parser. These illustrate how to do things like manage UART transmit and receive, decode of frames, and check multiple file descriptors for data.
Just saying you need to do the following sounds more like an assignment versus that you've envisioned an architecture like this for a particular reason.
You've posted code. Please explain where this code falls short and also what it does do at this point.