Programming :: Measure Time Of N Processes?
Oct 24, 2010
how can I measure time of N processes and N threads and then compare this time to prove that threads are faster than processes. understanding C code, or also for some good way to measure time of N processes and N threads for C.
View 5 Replies
ADVERTISEMENT
Jul 31, 2011
I have a C program like this:
...
CODE_BLOCK;
...
I want to know how much CPU time spent on CODE_BLOCK. Since the process executing CODE_BLOCK may be preempted during execution, this CPU time may not be equal to the (wall-clock) time elapsed from the beginning of CODE_BLOCK to the end of it.
View 3 Replies
View Related
Mar 16, 2010
I'm writing a script that needs to spawn 2 or more processes and wait for their return status. I have a method to do this by waiting on each process individually like this:
Code:
process1 &
PID1=$!
[code]...
View 14 Replies
View Related
Apr 15, 2010
I'm just wondering what the limits for time are. I have a program that always takes exactly 20 ms, so I assume this is the lowest it can measure, but I want to see if there's some sort of documentation of this.
View 3 Replies
View Related
Mar 12, 2010
I want to measure the startup time of any GUI app (e.g. firefox) using the time(1) command. However, timing is measured until the app is closed, which has to be done manually by exiting it or clicking X.
How can I get the app to load, terminate immediately and give me the startup time?
View 2 Replies
View Related
Nov 28, 2010
measure kernel space time and user space time?
View 1 Replies
View Related
Jan 4, 2011
In bash shell, is there a simple way for me to monitor the time taken to run a script and output the time taken?
View 1 Replies
View Related
Apr 24, 2010
I was wondering if you could help me how to measure the time needed for Ubuntu to copy a file from one place to another.
View 2 Replies
View Related
Dec 7, 2009
I've got the following problem:
1. I start two bash windows
2. In one of them I start a script test1:
Code:
This script puts a natural number 5 times a second.
3. Then in the second bash window I type (as root):
Code:
The script test2 looks as follows:
Code:
While true; do
true;
done
During the following 15 seconds test2 is the process with the highest real-time priority. As far as I know the script doesn't perform any system calls so it shouldn't be suspended even for a minimal timeslice. My question is: why the process test1 manages to put a few numbers on the screen before test2 stops. I thought that test2 would exclusivly own the processor for 15 seconds.
View 8 Replies
View Related
May 3, 2010
I don't know about your computer but when mine is working properly no process is sucking 95%+ over time. I would like to have some failsafe that kills any processes behaving like that. This comes to mind because when I woke up this morning my laptop had been crunching all night long on a stray chromium child process.
This can probably be done as a cron job, but before I make it a full time job creating something like this I'd thought I should check here. :) I hate reinventing the wheel.
View 1 Replies
View Related
Feb 20, 2010
I want to find the cumulative CPU time used by each process between two points (defined by the user, e.g. running a command or clicking a button).
A first stab at this would be running
Code:
ps -eo pid,cputime
at the beginning of the interval and at the end, then doing some arithmetic on the two sets of results. But this only shows whole seconds of cputime ... and what about processes that started and stopped during the interval?
View 1 Replies
View Related
Dec 18, 2009
I want to set my program with highest priority for real-time processes. I understand the priority for real-time processes ranges from 1-99, but I get completely confused after reading Understanding the Linux Kernel and the manual of sched_get_priority_max(): which value has higher priority? either 1 or 99. Understanding the Linux Kernel says 1 has highest priority but sched_get_priority_max() returns 99 for SCHED_FIFO and SCHED_RR policy.
View 3 Replies
View Related
Apr 27, 2010
I installed and configured privoxy - everything worked nicely when I run it manually by
Quote:
/etc/init.d/privoxy start
After restarting the computer privoxy wasn't start automatically. I checked the links in /etc/rcX.d - are o.k. I installed sysv-rc-conf - shows that for runlevel 2 - 5 privoxy is running. I changed /etc/rc2.d/S20privoxy to /etc/rc2.d/S99privoxy - to start that process at the end. I installed Boot-Up Manager. Privoxy is marked for start automatically. I added in /etc/rc.local line: /etc/init.d/privoxy start
Privoxy still doesn't turn on at boot time and every time I must start it manually. Could you tell me how could I repair this ?
View 4 Replies
View Related
Feb 11, 2010
I have what I think is a somewhat different failure of standby than I've seen listed on other threads, and I'm stumped.The system hangs on this for a while, then comes back to the login screen without going into standby. This ONLY HAPPENS on a SECOND standby attempt--the first standby after booting ALWAYS succeeds.The standby log doesn't indicate any failures.I had made other changes previously that temporarily got standby working consistently:/etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1"
View 1 Replies
View Related
Jul 28, 2010
I am doing real time programming in C++, under Linux. I have two processes, let me say A and B. A process is being started periodically, every 5ms. B process is being started every 10ms. The process A is doing data processing. The process B is reading that data and displays it. I am confused about how to run periodically processes. The problem is that the period of process A should be as much as it is possible accurate (5ms). For the process B it isn't so important. I have created independent processes, each in one .cpp file, and I am starting them from bash file. Is that OK? I don't have to make child processes in order to have parallel processes?
View 1 Replies
View Related
Sep 29, 2009
I have 2 completely different processes A and B (they do not have any relationship) suppose A opens a file with file descriptor 4 and B opens another file with file descriptor 5
Can process A use the fd 5 (i.e using the file object of processs B) by any means..if suppose i let the fd 4 of process A to point to the file object of process B(fd 5) will it work? is it safe?
View 3 Replies
View Related
Dec 3, 2010
I have my code with my fork in a server and each time a client connects one more process is created. i use this code for the handling of zombies
void sig_chld(int signo){//Diadikasia gia tin diagrafi twn 'zombies'
signal( SIGCHLD, sig_chld );//signal gia ton entopismo tou zombie
pid_t pid;
[code]....
but i need the server to kill each zombie after the client is disconnecting and not to have to press ctrl+c
View 1 Replies
View Related
Feb 11, 2011
How to switch between processes when debugging with gdb?
View 2 Replies
View Related
Nov 18, 2010
how to even start this Perl script. I have the following processes:
Command used to get this info:
ps aux --forest | grep -e process_name -e ksh | awk '{if ($1 == "user1" && $1 != "root" && $1 != "UID" && $1 != "xfs" && $1 != "mfg" && $1 != "mfgnet") print $0}'
Processes
user1 2819 0.0 0.0 4272 612 ? S Nov17 0:00 \_ -pksh-ksh
user1 2820 0.0 0.0 64956 1584 pts/833 Ss+ Nov17 0:00 \_ -ksh
[code]....
I need a way to kill off the pids 2819, 2820 because they do not have a process tied to them like pids 2918, 2922 and 6657. The way it works is peek shell (pid 2918)is opened then it starts a ksh (pid 2922) session then from there the end user runs a command (pid 6657).
View 7 Replies
View Related
Mar 2, 2011
I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?
View 14 Replies
View Related
Sep 6, 2010
I work on Linux for ARM processor for cable modem. There is a tool that I have written (as the job demands) that sends/storms customized UDP packets using raw sockets. I form the packet from scratch so that we have the flexibility to play with different options. This tool is mainly for stress testing routers.
The details are here.
I actually have multiple interfaces created. Each interface will obtain IP addresses using DHCP. This is done in order to make the modem behave as virtual customer premises equipment (vcpe).
When the system comes up, I start those processes that are asked to. Every process that I start will continuously send packets. So process 0 will send packets using interface 0 and so on. Each of these processes that send packets would allow configuration (change in UDP parameters and other options at run time). Thats the reason I decide to have separate processes.
I start these processes using fork and excec from the provisioning processes of the modem.
The problem now is that each process takes up a lot of memory. Starting just 3 such processes, causes the system to crash and reboot.
I have tried the following:- 1-I have always assumed that pushing more code to the Shared Libraries will help. So when I tried moving many functions into shared library and keeping minimum code in the processes, it made no difference to my surprise.
2-I also removed all arrays and made them use the heap. However it made no difference. This maybe because the processes runs continuously and it makes no difference if it is stack or heap?
3-I suspect the process from I where I call the fork is huge and that is the reason for the processes that I make result being huge. I am not sure how else I could go about. say process A is huge -> I start process B by forking and excec. B inherits A's memory area. So now I do this -> A starts C which inturn starts B will also not help as C still inherits A?. I used vfork as an alternative which did not help either. I do wonder why.
reduce the memory used by each independent child processes.
View 1 Replies
View Related
Oct 14, 2010
the wrong part of the forum but basically im working on a project and getting no where what so ever and i was wondering if i could get your help. Basically i have to create two scripts do:
The parent script which is going to:
o spawn several child processes.
o keep track of the progress of the child processes.
[code]...
View 1 Replies
View Related
Dec 27, 2010
I am building a queue system (in C on CentOS 5) where each directory queue has a number of process instances 'watching' it. I have a root-permission queue supervisor process which does all the forking, and the instance processes give up root as their first action. For max security each queue is accessible to a different set of users and groups.
I need to keep the RAM requirements as low as possible, so I am relying heavily on copy-on-write (since all memory writes are to shmget() shared memory)
Each process presently dlopen's the libraries it requires after fork, but I'm wondering if I would gain by performing the dlopen before forking a number of instances which all require the same libraries.
Any pointers to mid-level tutorials on dlopen and fork internals would be most appreciated: this is about my third post anywhere since I converted to Linux, but I just can't find the answer to this anywhere online.
View 3 Replies
View Related
Jun 3, 2011
How do you list processes, get a process's std(in|out|err) stream, or wait until a process is finished in C?
View 3 Replies
View Related
Oct 13, 2010
If a process forks its child and communicate with the child using pipe, do closing the write end of the pipe and terminating the writing process have the same effect?
View 3 Replies
View Related
Sep 28, 2010
The ipcs command shows the facilities of IPC in Linux, but it does not shows the processes that communicating to each others. How can I list the processes, which is currently communicating in IPC ?
View 6 Replies
View Related
Oct 21, 2010
User 1 and User 2 each start a mono process with sudo:
"sudo mono user1.exe" "sudo mono user2.exe"
Each user has a kill.sh in their directory, which is being called by user1.exe/user2.exe to kill the process.
The script itself is
ps aux | grep 'mono user1.exe' | awk '{print $1}' | xargs kill
which in theory should pull *only* the PID of "mono user1.exe" and kill only that. The problem: It kills any and every single instance of mono that is running on my system, every userx.exe thats open. I am confused, as a simple "ps aux | grep 'mono user1.exe'" does only return the mono user1.exe process and not the others. "ps aux | grep 'mono'" returns them all though. how I can modify that script so that it only kills the specific process? Would "pkill -9 -f 'mono MCuser1.exe'" work as well - or would it too kill every instance of mono? I cant do a lot more of trial and error, its not good I am killing those instances accidently...
View 14 Replies
View Related
Oct 23, 2010
As an assignment i was doing a program to create two process using fork and pass messages between them using message queue.Did it worked well until my friend tried to copy it using scp.suddenly all hell broke loose as processes without ran syncronisation ie. in tech terms the process just wont wait wen a message queue is empty.it keeps on executing randomly.but after a reboot .. everything worked fine. until again i tried to do scp on my system on purpose. and again the program just went mad.
View 3 Replies
View Related
Aug 18, 2009
I have p1,p2,p3,p4 some processes created by me in C. p1, p2, p3 are started individually from several consoles. And I want process p4 to terminates processes p1, p2, p3 if they are running. Which is the easiest way to accomplish that? put all processes in the same process group and send from p4 a kill signal to the group. But I couldn't do that because I cannot call successfully setpgid(getpid(), 15000) from p1-p4. It's there some way to put them in the same group? the processes don't have a child-parent relationship, they are launched manually from consoles.
View 1 Replies
View Related
Feb 27, 2011
I have two processes that share a piece of memory, and i want to use the shared memory to send data from one process to the other. it's like a simple consumer-producer problem. when the producer fills the shared memory, it waits until the consumer can consume some data in the memory; the consumer needs to wait if there is no data in the memory. The thing gets complicated when both threads are allowed to sleep and wait for the other to wake it up.
i wanted to use condition variable of pthread for synchronization, but it doesn't work in multiple processes. i tried semaphore, but it's quite complicated and i still cannot make it right. I believe it's a common problem and someone should have written similar code before, or maybe the code is even wrapped in a library, but when I search for it on Internet, I only found information about how to share memory between processes. Does anyone know where I can find this kind of code or library?
View 2 Replies
View Related