Programming :: MultiThreaded Program In C++?

Oct 23, 2010

I have a program called "Device Manager" to manange usb tokens for sending and recieving
multiple data to/from them using shared memory method.Here is a piece of "Device Manager" code:

Code:
int main()
{

[code]...

View 3 Replies


ADVERTISEMENT

General :: Profile A Multithreaded Program Using Gprof?

Jan 7, 2010

How to profile a multithreaded program using gprof?

View 1 Replies View Related

Programming :: Multithreaded App Using Pth Does Not Work?

Mar 4, 2010

I threw this togher based on the examples but the thread does not seem to run:

Code:
#include <stdio.h>
#include <pth.h>

[code]...

View 3 Replies View Related

Programming :: Debugging Multithreaded Application?

Aug 23, 2010

i need to debug a application which is using many threads. i am using eclipse with GDB debugger but it is not possible to debug it since it has a lot of different threads and i can not not debug it as wre debug in case of single thread(main) . So i would like to know, is there a way to debug such an application, if there is some tutorial that would be nice to know.

View 8 Replies View Related

Programming :: Multithreaded Reading And Writing Of A Shared Integer?

Nov 4, 2010

It it safe to read a shared integer while another thread is writing to it on a multicore system?

View 3 Replies View Related

General :: Multithreaded Application / CPU And Memory Usage

Feb 14, 2009

We run Jboss app server that of course is all multithreaded under one JVM. I have couple of question regarding monitoring on per thread basis:

1. Is there a way to see which thread is bound to which CPU core?
2. Is there a way to see the CPU, Memory usage per thread? Something like prstat on Sun box which is real time and gives detailed information about threads per CPU

View 6 Replies View Related

Software :: Limiting CPU Usage Of A Multithreaded Process?

Oct 12, 2010

I have a multi-threaded process running and I have to limit the cpu time used by each of the threads. If 1 of the threads uses the whole of configured CPU time, the other thread should sleep and not consume CPU time in that cycle. 1 thread has higher preference over the other. How can i implement it my CPP code?

View 1 Replies View Related

Programming :: Program A SH - Bash Program With Zenity To Play Radio Based On A Site?

Feb 15, 2011

I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html

My code to get url's radio country.htm is:

Code:

View 2 Replies View Related

Programming :: Open Or Run A File/program Through A C++ Program

Jan 15, 2010

Ok so Basically i have 2 questions

1. i know how to create a file with c++ using but is there a way to save it to a specific location on your computer with windows and linux

Code:

2. i need to know how to run/execute/open a file in a c++ program im using and its not working

Code:

View 4 Replies View Related

Programming :: Build A Simple Program For C Programming Class?

Feb 12, 2011

im trying to build a simple program for my C programming class, this is the source code

#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;

[Code]...

i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?

View 5 Replies View Related

Programming :: Gcc And Pow In A C Program?

Feb 5, 2009

I found some interesting behavior when discussing the pow function from Math.h with someone. I am well aware of the need to compile with the -lm flag, but to my surprise this actually isn't necessary if the arguments to the pow function are literals. For example, this program compiles in gcc without using -lm:

Code:

#include <stdio.h>
#include <math.h>
int main()

[code]....

If I try to change the call to any of these:

Code:

double bCubed = pow(2.0, e);

Code:

double bCubed = pow(b, 3.0);

Code:

double bCubed = pow(b, e);

Then the -lm option is required or else it can't compile. So does anyone know why it's necessary to use -lm when the argument(s) is/are variable(s) but it works fine if both arguments are literal values? As a side note, any of the above compile with g++ however. Also, if it helps, this is the version of gcc I'm using:

gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)

This doesn't happen on my Mac however that is running: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)

View 3 Replies View Related

Programming :: Getting TTY Id From A C Program

May 23, 2009

I am new to linux/c programming and I am trying to get TTY id from my c program. Something like this:

int TTYID = get_ttyid();

How do I do that?

View 1 Replies View Related

Programming :: Error In My C++ Program ?

Mar 15, 2011

The following is the error in my program :

Here is my program...

View 7 Replies View Related

Programming :: Autorun Program In C++

Mar 10, 2010

With what functions i can write my program in /etc/init.d with c++ to start every time the computer starts ? (like in windows with RegOpenKey,RegSetValueEx..............) ?

View 4 Replies View Related

Programming :: C Program To Get Cpu Utilization?

Feb 26, 2010

language:cOs: ubuntuI have googled for a c program to get cpu utilization factor from 2 days.We can get it through "top", "who" commands..But I hav not found any API or a program.

View 5 Replies View Related

Programming :: Chat Program In C

Aug 17, 2010

Am new to this community and this is my first post. am doing a project where i have to develop a wireless ad hoc routing protocol. I have just begun working on the project. I did not know where to start, so started off with a simple chat program using TCP and thought of making the modifications to it later on. But I do have a prob even i running that!

Am not getting the messages in a synchronized manner. The prog is running fine, but the messages that i type from the server are not reaching the client at all, and at times some garbage values are getting printed(When the strcmp()fn returns 1, "connection terminated" gets printed timely in both the sides. this is the oly situation where i do not get garbage values.) am using VC++ 6.0 here.I have been breaking my head for the past 3-4 days for this simple issue. any response to this would be of great help.

View 14 Replies View Related

Programming :: How To Use __attribute In My Program

Nov 22, 2010

I have checked following two pagesand this page also In following program I want to use attribute keyword of C and format string as printf

Code:
#include<stdio.h>
int myfunction (int ,int);

[code]....

View 1 Replies View Related

Programming :: Make A GUI Program From C?

Jun 30, 2010

I want to know how can I make a GUI program from a shell program I coded in C a long time ago. Can anybody point me to good tutorials?

View 4 Replies View Related

Programming :: How To Program Effectively

Jan 29, 2011

I'm new to programming under linux (not new to programming). Before that I have written c++ codes in Visual Studio under windows for some years. I read some tutorials and learned editing codes with vim and compile codes with g++ or make tool. And I tried gdb.

But I think compared to my coding experience in Visual Studio, these steps are very ineffective. With VS, after I wrote codes, I just press ctrl+f7 to compile and ctrl+f5 to run the codes. If I want to debug, press f5, and I can see every variable in a 'watch' window.

Under linux, after I write codes, I need to quit vim, type make to compile. If I have some mistakes, I have to remember the line numbers and re-open vim to check the errors. And I think debugging with gdb is so hard.

I think as a newbie to programming under linux, maybe I haven't find the right tools. Or programming under linux is just so hard so a programmer who can overcame these could be strong enough to do programming without some IDE tools?

View 8 Replies View Related

Programming :: How To Start Program

Dec 20, 2010

I want to make alarm(buzzer) and Lamp(led) to work from infrared sensor output via usb.When ir sensor detect motion it will make the alarm&lamp on. Then also sending mail. Im using pic 18f2550-1/sp(usb Fsio from km2.net).But i dont know how to start the program.

View 2 Replies View Related

Programming :: Use G++ To Compile QT Program?

Dec 26, 2010

My Fedora 14 have installed gcc-4.5.1-4.fc14.x86_64,qt-4.7.1-5.fc14.x86_64,
I don't know how to use g++ to compile QT program.
Do I need to set PATH or something else?

View 5 Replies View Related

Programming :: Write A Program (in C)?

Feb 26, 2010

I want to write a program (in C), which does 4 or 6 simultaneous calculation. Is there away of doing something like:

do at the same time{
Core 1 do:
this_thing_1

[code]....

View 3 Replies View Related

Programming :: Output Of The C Program?

Jun 8, 2009

See the first program below :

Code:

This code when compiled gives the following errors:

1. conflicting types for 'fun' at line no: 9

2. previous declaration of 'fun' was here at line no: 3

Why is this happening?

If i modify the above program as shown in the second program below:

Code:

This code when compiled gives no errors.

Why the difference occurs between the first and second program?

View 8 Replies View Related

Programming :: Build A Spi Program Using C++?

Jan 19, 2011

I'm trying to build a spi program using c++. I'm able to perform half-duplex transfers using the read/write functions, it works perfectly. Now I need to perform a full-duplex transfer, but I'm facing some problems. When I try to receive more than one byte, the slave returns to me only one byte.Ex: I send: FF FF FF FF FF The slave must return: 03 02 00 13 04 But what is happening is:

1st Transfer:

tx: FF FF FF FF FF
rx: 03 00 00 00 00

2nd Transfer:

tx: FF FF FF FF FF
rx: 02 00 00 00 00

[code].....

View 3 Replies View Related

Programming :: Compile A Program With Gtkmozembed?

Apr 21, 2010

i am not able to compile my test program which uses gtkmozembed.As i am very new to this, i dont know which are the packages to be installed and how to compile

[Code]...

View 1 Replies View Related

Programming :: How To Use Cryptographic Techniques In C Program

Jun 23, 2010

i have a simple client and sever program in C language. in which client is requesting some parameters( like system up time, memory, no of process etc) form server and server send this information to client.now i want to use DES, AES.RSA. BLOW FISH algorithm to this communication to make it secure. actually i have to compare performance parameters of these cryptographic techniques.but i don't know how to use SSL libraries as SSL library support these cryptographic techniques. but i have no idea how it will work for me

View 4 Replies View Related

Programming :: C/C++ - Program Detecting New Sockets

Jul 25, 2010

I need to create a C/C++ program in Linux that succeeds in detecting how many tcp-sockets and what tcp-sockets are created by the other processes in the system in a particular time interval (e.g., the interval time this application is running in). Then, I'd need to get some information like local/remote port number and local/remote ip address of each of these sockets.

View 8 Replies View Related

Programming :: Created First Little Program In C++ That Im Happy About?

Sep 4, 2010

Code: //Author: Donald Farkas
//Created: Sep/4/2010
#include <iostream>

[code].....

View 6 Replies View Related

Programming :: Managing Instances Of A Program?

Mar 23, 2011

I finished a program that connects to a remote server and does some stuff there for a while. What I want to do is to run several instances of the program to have different connections at the same time, and to be able to manage those processes automatically (for example, if the connection stops, detect it and reconect).

I guess I will have to use the pid of the processes and handle them somehow but I dont really know what to do because I haven't used c++ in a while and I never went that deep. All this will be running in suse, debian and/or yellowdog distros Maybe there's a tutorial or you guys know some tool that i can use,

View 3 Replies View Related

Programming :: Program To Use Grep W/regex?

Jun 1, 2011

I'm just starting out with bash scripting (yesterday, really). I want to add a file to each user's home directory, pretty simple really, and send it out via our Apple Remote Desktop system to our Macs. Here is my script: Code: #!/bin/bash

for i in $(ls -d /Users/*)
doif [ -e $i/.tcshrc ]
thenecho "$i/.tcshrc exists!"elseecho "$i/.tcshrc does not exist"

[code]....

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved