C++ :: How To Create Zombie Process
Nov 25, 2014
I am looking into how to create zombie process. They are created when parent process don't call wait() and hence they are not removed from the process table. How do I create zombie process in C++? What part of the code when missed, make a process/thread zombie? Is it the pthread_join()?
View 2 Replies
ADVERTISEMENT
Nov 18, 2013
I want to create 9 child processes and eventually write from each process to another. How can I specifically create 9 child processes and leave them running? Right now, I am using a loop from i=0 to i=8 and running fork() within that loop, but each child process also runs the loop, which spawns dozens (maybe hundreds?) of processes. I specifically only want to create nine of them. How can I do this?
Code:
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
[Code].....
View 7 Replies
View Related
May 30, 2014
I have study that create a pipe and set a terminal of this pipe like a stdout of a process is a way to implement inter process comunication, but how can i do it in c++?
View 2 Replies
View Related
Feb 13, 2014
I have a problem with creating a process and waiting until the main window of the new process was shown. I thought I can wait for it with
WaitForInputIdle(pi.hp,INFINITE);
But when the function returns, the handle of the main window of the new process is not available. If I include also a ::Sleep(), the new window is available. Sleep is a bad solution. How can I do it?
View 3 Replies
View Related
Oct 26, 2013
I have a struct called Array and I'm to create a function to create a dynamic array that's fill with randomly generated integers from 0 to 50 (inclusive) and a function to destroy the array for freeing its memory. Below the code that I have written so far.
Code:
* Struct */
typedef struct {int *pArray; //the dynamic array
int length; //the size of the dynamic array}Array;
/* Function to create a dynamic array */
Array *initializeArray (int length) {int i;
}
[code]....
View 7 Replies
View Related
Dec 13, 2013
I have app that has while true on input listening to changes and then in some condition needs to open simple gtk app, and afterwards continue listening.
I thought that i could fork gtk part, and kill it when it is not needed.
But am not finding much examples on internet. 2 processes dont share data. Can child process start a gui app? And is this a good approach.
View 1 Replies
View Related
Mar 8, 2013
I am looking for a way to run a process form memory, without having any executable. The application will be kept inside a resource and will be extracted during run time. It should be then started as a new process. I couldn't find a solution that works also on x64
View 5 Replies
View Related
Apr 10, 2014
I need to create a project that create a automated backup of a file.
i will get the file from C:/Folder/file.exe and move for a other created folder, but.. in every time that user make this backup, a folder will be created with year, month and date, like: C/Folder2/2014/April/16:42/file.exe.
View 4 Replies
View Related
Jan 31, 2015
I need my Unix program to generate a directory with a format like this: "hinesro.<pid>". I have some code that mostly works, except for the directory ends up with a question mark on the end, like this: "hinesro.12345?". I need it to just display the directory without this question mark. Here is my code:
Code:
// Using headers sys/types.h, sys/stat.h, unistd.h, and stdio.h
int pid = getpid();
char prefix[] = "hinesro.";
char fileName[0];
sprintf(fileName, "%s%d
", prefix, pid);
[Code]...
View 13 Replies
View Related
Sep 5, 2013
i have read that inheritance slows down the process.because a_class -> b_class -> c_class it goes thorough many classes to find a function or a value. people advices not to do it more than a few times. what if instead of inheritance we are using headers, would it slow down the process also??i mean which one is faster? and arent both the same when we use headers or used inheritance.
View 3 Replies
View Related
Apr 9, 2015
Am developing windows forms application where in my form am fetching data into list from some object which takes around 2 minutes to complete processing so meantime i want to show progress bar before starting process till it ends with percentage. I have return a code to do multitasking but it is throwing error as "Cross-thread operation not valid: Control 'listOrg' accessed from a thread other than the thread it was created on".
private void btnOrg_Click(object sender, EventArgs e) {
try {
// To report progress from the background worker we need to set this property
backgroundWorker1.WorkerReportsProgress = true;
[code]....
View 1 Replies
View Related
Mar 29, 2014
I would like to ask about editing proccess memory.For example,I would like to create some program for a multiplayer game which I play.How do I work with memory adresses and what are commands for it.
View 1 Replies
View Related
Nov 5, 2014
I was given an assignment where I have to input two points (four integers) on a Cartesian plane from a file and then process it using functions. My professor is very particular so the comments are a bit excessive, but here's what I have.
double radiusFn(double, double, double, double);//4 double values, one for each point. All points are needed for the calculation of distance in this function.
double diameterFn(double);//Only uses one double value - the radius. Both functions below use the same value.
double circumferenceFn(double);
double areaFn(double);
int main() {
[code].....
The file reads:
Quote
1 2 3 4 5 6 7 8 9 10 11 12
View 2 Replies
View Related
Oct 11, 2012
how I can run this as a separate process from the parent program, like a child process,
and return the result back to the parent program.
this script is as follows.
if file "/Stuff/s" exists then continue to run, if file "/Stuff/t" exists, then print "started" if file "/Stuff/t" does not exists, then print "stopped"
if file "/Stuff/s" does not exist then print "quit" and then quit.
Code:
void controlxmmscheck( ) {
if( access( "/Stuff/s", F_OK ) != -1 ) {
xmmscheck
} else {
[Code]....
View 1 Replies
View Related
Feb 21, 2015
tell me which .dll or library I'm supposed to use to link this program:
#include <iostream>
using namespace std;
void antpost (int num, int& anterior, int& posterior) {
anterior = num-1;
posterior = num+1;
[Code] ....
I think my linker needs an additional #include to be able to deal with int& anterior and int& posterior. I'm not sure as I'm new to C++. My version of Dev-C++ is Orwell V5.8.3.
View 4 Replies
View Related
Feb 14, 2012
I'm wondering whether it's possible to implement MPI to execute a process in parallel from deep within a C++ solution.
I've created a solution on VS2005 that links to several static libraries, and within one of these libraries there is a set series of tasks that require execution many times - they're independent so I'd like them to execute them using MPI if possible to speed up the run time.
The pseudo-code is:
Code:
for(i = 0; i < n; i++) // n is number of times to execute process {
PerformTask(data[i]); // perform the tasks required for each iteration of process
}
So, instead of conducting the tasks within PerformTask() in series n times, I want to split the array data between multiple processes such that they can each be allocated an even proportion of data to perform the tasks on. Pretty textbook reason for wanting MPI, right?
Now, I've read up and understood the basics of MPI implementation, but all the examples I've seen are called within the main() function of the program. But I need to do all this from within a static library, is this possible?
I've made some early attempts at implementing this, but get an error indicating the process wasn't initialised: "Error encounted before initializing MPICH", which I assumed would be due to trying to make the MPI calls outside of the main() function.
View 4 Replies
View Related
Oct 24, 2013
is this possible? How do i inject html into a process like firefox.exe or iexplore.exe? any tutorials/ starting point?
View 1 Replies
View Related
Oct 26, 2013
I'm creating a small command line game in C. I have never done anything cross platforms, but this is small enough (so far) that it might not be too bad.
When I am done, I'm not sure how it will be distributed: Either I will just send people the C files and say "compile on your system with these options", or I will just have executables for various systems. Probably Windows 7/8, Ubuntu, CentOS, and whatever I can find to test on.
I right now I'm testing/developing on Windows 7 using MinGW. So my questions are: while I'm developing, how should I be compiling/testing it?
View 4 Replies
View Related
May 15, 2014
I want to write RPC program in C for matrix multiplication - My question is that during serialization & deserialization process ,what shall I keep in mind? I recently got an error "call failed: RPC: Can't decode result " ,what this means?
My program is simply send an array A and return 3*A.
View 2 Replies
View Related
Aug 11, 2014
I am starting to use contiki and learn c programming for my summer internship. I have to calculate the mean of the ongoing process of refrigerator power. I made the code like this
Code:
#include <stdlib.h>
#include <stdio.h>
#include <homadeus/processes/fridge_process.h>
#include <homadeus/devices/78M6610.h>
#include <homadeus/utils/utils.h>
float global_variable;
int current_state = 0; //down =0, up =1
[Code]....
How it gets the value of power is handled already. Every one second, it will display the power consumed (get_instant_power()). I don't know how to start and end the sample numbre. If I start by 1 then how should it be until? Also, is it possible if I store the power in array to accumulate?
View 1 Replies
View Related
Dec 7, 2011
I have a program that I can only run one instance of. When I try to start it a second time, it doesn't do anything. I would like to create a script that loads the program in a way that I can run multiple instances. Since I assume the program checks the process tree on startup to see if an other instance is already running, I figure disabling access to the process tree could do the trick.
View 6 Replies
View Related
Jan 27, 2014
1. I want to do 2 while at the same moment. Exactly I want one while which is checking the time and it should di something every X second and the other should check something parallel.
2. How i can write the program what i write automaticly into the autorun on every windows pc.
3. Can i change the process-name when the programm started?
4. Can i save my .exe under another name in the autorun
View 3 Replies
View Related
Dec 21, 2013
This code will read the running process from OS and display it (C++). Specifically, the OS here is Windows XP. The Problem(error) is in (i think) prototype. By the way, it displays following errors.
Error 1 : error LNK2019: unresolved external symbol _EnumProcesses@12 referenced in function _main
Error 2 : error LNK2019: unresolved external symbol _GetModuleBaseNameA@16 referenced in function "void __cdecl DisplayProcessNameAndID(unsigned long)" (?DisplayProcessNameAndID@@YAXK@Z)
Error 3 : error LNK2019: unresolved external symbol _EnumProcessModules@16 referenced in function "void __cdecl DisplayProcessNameAndID(unsigned long)" (?DisplayProcessNameAndID@@YAXK@Z)
Error 4 : fatal error LNK1120: 3 unresolved externals C:Documents and SettingsWindowsMy DocumentsVisual Studio 2008ProjectsaDebuga.exe
#include <afxwin.h>
#include <iostream>
#include <string.h>
#include "psapi.h"
unsigned int i;
using namespace std;
[Code] .....
View 2 Replies
View Related
Mar 9, 2013
In the existing code,fork has call parallel to create process.my job is to store all the process id into vector so that we can verify the status of the jobs. I was able to save all the jobs but as the callback happen so I have lost my all value which was store into vector.
How can i maintain variable between multiple process.
View 1 Replies
View Related
Oct 3, 2014
what is the process of student profiling system using c++?
View 2 Replies
View Related
Sep 21, 2014
I have several machines (could be 1, 2, or 30) sending/receiving data to/from a computer via Wi-Fi. At the moment I am in the process of trying to store that data into txt files, but that is another issue. Say that I managed to have different txt files to pick up the information received, one per machine, now what I need is to process that information in the following way (will show with an example):
String data ("W" followed by the value that I need to process) is sent to the computer by every single machine, every 100 milliseconds, like:
W0.000
W0.000
W1.000
W25.000
W56.000
W70.000
W100.000
W100.000
W100.000
W123.000
W98.000
W30.000
W10.000
W0.000
W0.000
For the example above I need to store the value "100" (in a .csv file, one per machine) as it is the last "stable" value before the reading drops quickly to zero. Afterwards, I would use the stored data to create graphs and summaries, in a "live" mode, so the graphs are refreshed with the new data as they come in from the machines. I am using C++ with Visual C++ Express.
View 2 Replies
View Related