ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
if(OutChannel.size() < buffer_size) //here OutChannel is a list for structure pointers: packets.
pkt = buffer_queue.front();
//Here depending upon the type of the packetype, and the channel availability, they are sent to destination nodes. The pkt_Received method is called upon by the destination node when it receives the packets, here the whole linked list.
//Packet Dropped: Output Channel Occupied,Wait for the Next Round
:The Problem is I get "terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc " error when I try to create huge numbers of packets in my program, I am using Message-Size from the trace file to determine the numbers of packets to be created for each object node, I am creating a mesh of 16 nodes here, which communicate to each other.
With small number of messages the program runs fine. I am not sure if
"delete previous" is the right way to free the memory..
Yes, in the code all these are structure pointers
packet *head, *body, *tail;
I am sorry for the incomplete code.
I was trying to cut my code to make it readable, so I missed the preceding if statement.