Sponsored Content
Top Forums Programming Daemon...Zombie?? Please help me Post 71356 by Perderabo on Tuesday 10th of May 2005 09:40:10 AM
Old 05-10-2005
I don't understand what your program is supposed to be doing, so I don't know what it should look like. I would tend to fork and then ignore signals in main. It's not wrong to do stuff like that in a function. But I don't know if you want to repeatedly call List in a loop or not. If it is called repeatedly, then you need to remove one-time initialization from it. I will close this thread now. If you still have problems you need to talk to your instructor.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

zombie program

When you run a ps -ef and if the status is a Z (zombie) does that mean the same as not responding? (Like a windows machine). Also has anyone here heard of the program called 'top' (I've found it on our Solaris 7 machines) If you have you might be able to help me. I need to know if there is a... (8 Replies)
Discussion started by: merlin
8 Replies

2. UNIX for Advanced & Expert Users

Zombie process

I would like to create a zombie process so that I can test monitoring software functionality. Any techniques? (2 Replies)
Discussion started by: swhitney
2 Replies

3. UNIX for Advanced & Expert Users

zombie daemon process!!

My daemon process is the child of init and init has the responsibility to remove it, once it turns zombie. But I want to ask why the daemon process which is child of init turns zombie in the first place. What measures I have to take to avoid this? rish (1 Reply)
Discussion started by: rish2005
1 Replies

4. Shell Programming and Scripting

Zombie process

Hi I need help because I don't know if it is possible to add a find inside a cat. like I have a file with the pid of the process that use to became zombie. And I have the same pid stored in the var (pid1) now, I have no clue how to check if the the find finds the pid or even if it's... (2 Replies)
Discussion started by: ruben.rodrigues
2 Replies

5. Solaris

zombie process

dear friends, in an interview they asked me what is zombie process. how we can identifying these process.if can you kill all zombie process. (8 Replies)
Discussion started by: sijocg
8 Replies

6. AIX

zombie process

Is there an equivilant to the preap command in AIX that would allow me to get rid of a zombie process. I am new to AIX, moving over from Solaris and in the past I have been able to preap the pid on the defunct process to clean them up. I have looked around and the best I can see is that it may... (3 Replies)
Discussion started by: sboots
3 Replies

7. UNIX for Dummies Questions & Answers

what is zombie , how to kill it ,

Hello I try to googled it , but I dint get sufficient answer :( .. When I can see zombie running on server do they consume system resources or not ? I have read that is not good to kill them with signal 9 cause it might cause more troubles .. why is kill -9 so harmfull? thanks (2 Replies)
Discussion started by: kvok
2 Replies

8. UNIX for Advanced & Expert Users

Zombie process

What is the overhead associated with zombie process?Is it running out of process-ID?:confused: Since some information is stored in process table.. Thanks in Advance (4 Replies)
Discussion started by: jois
4 Replies

9. Red Hat

zombie

Hi, Linux redhat 5.5 top shows that i have 20 zombie process : Tasks: 357 total, 1 running, 336 sleeping, 0 stopped, 20 zombie Cpu(s): 0.2%us, 0.3%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 24949400k total, 2363052k used, 22586348k free, 227084k buffers... (1 Reply)
Discussion started by: yoavbe
1 Replies

10. Programming

Zombie in C

hello all, when we are creating a process by using fork, if the child process terminates before parent, the child process exists as zombie.. My doubt is when that child process terminates, how come that process exists further and show as a zombie process..can anyone help me to clear about this? (1 Reply)
Discussion started by: aarathy
1 Replies
AnyEvent::FAQ(3pm)					User Contributed Perl Documentation					AnyEvent::FAQ(3pm)

NAME
AnyEvent::FAQ - frequently asked questions The newest version of this document can be found at <http://pod.tst.eu/http://cvs.schmorp.de/AnyEvent/lib/AnyEvent/FAQ.pod>. My program exits before doing anything, what's going on? Programmers new to event-based programming often forget that you can actually do other stuff while "waiting" for an event to occur and therefore forget to actually wait when they do not, in fact, have anything else to do. Here is an example: use AnyEvent; my $timer = AnyEvent->timer (after => 5, cb => sub { say "hi" }); The expectation might be for the program to print "hi" after 5 seconds and then probably to exit. However, if you run this, your program will exit almost instantly: Creating the timer does not wait for it, instead the "timer" method returns immediately and perl executes the rest of the program. But there is nothing left to execute, so perl exits. To force AnyEvent to wait for something, use a condvar: use AnyEvent; my $quit_program = AnyEvent->condvar; my $timer = AnyEvent->timer (after => 5, cb => sub { $quit_program->send }); $quit_program->recv; Here the program doesn't immediately exit, because it first waits for the "quit_program" condition. In most cases, your main program should call the event library "loop" function directly: use EV; use AnyEvent; ... EV::loop; Why is my "tcp_connect" callback never called? Tricky: "tcp_connect" (and a few other functions in AnyEvent::Socket) is critically sensitive to the caller context. In void context, it will just do its thing and eventually call the callback. In any other context, however, it will return a special "guard" object - when it is destroyed (e.g. when you don't store it but throw it away), tcp_connect will no longer try to connect or call any callbacks. Often this happens when the "tcp_connect" call is at the end of a function: sub do_connect { tcp_connect "www.example.com", 80, sub { ... lengthy code }; } Then the caller decides whether there is a void context or not. One can avoid these cases by explicitly returning nothing: sub do_connect { tcp_connect "www.example.com", 80, sub { ... lengthy code }; () # return nothing } Why do some backends use a lot of CPU in "AE::cv->recv"? Many people try out this simple program, or its equivalent: use AnyEvent; AnyEvent->condvar->recv; They are then shocked to see that this basically idles with the Perl backend, but uses 100% CPU with the EV backend, which is supposed to be sooo efficient. The key to understand this is to understand that the above program is actually buggy: Nothing calls "->send" on the condvar, ever. Worse, there are no event watchers whatsoever. Basically, it creates a deadlock: there is no way to make progress, this program doesn't do anything useful, and this will not change in the future: it is already an ex-parrot. Some backends react to this by freezing, some by idling, and some do a 100% CPU loop. Since this program is not useful (and behaves as documented with all backends, as AnyEvent makes no CPU time guarantees), this shouldn't be a big deal: as soon as your program actually implements something, the CPU usage will be normal. Why does this FAQ not deal with AnyEvent::Handle questions? Because AnyEvent::Handle has a NONFAQ on its own that already deals with common issues. How can I combine Win32::GUI applications with AnyEvent? Well, not in the same OS thread, that's for sure :) What you can do is create another ithread (or fork) and run AnyEvent inside that thread, or better yet, run all your GUI code in a second ithread. For example, you could load Win32::GUI and AnyEvent::Util, then create a portable socketpair for GUI->AnyEvent communication. Then fork/create a new ithread, in there, create a Window and send the "$WINDOW->{-Handle}" to the AnyEvent ithread so it can "PostMessage". GUI to AnyEvent communication could work by pushing some data into a Thread::Queue and writing a byte into the socket. The AnyEvent watcher on the other side will then look at the queue. AnyEvent to GUI communications can also use a Thread::Queue, but to wake up the GUI thread, it would instead use "Win32::GUI::PostMessage $WINDOW, 1030, 0, """, and the GUI thread would listen for these messages by using "$WINDOW->Hook (1030 (), sub { ... })". My callback dies and... It must not - part of the contract betwene AnyEvent and user code is that callbacks do not throw exceptions (and don't do even more evil things, such as using "last" outside a loop :). If your callback might die sometimes, you need to use "eval". If you want to track down such a case and you can reproduce it, you can enable wrapping (by calling "AnyEvent::Debug::wrap" or by setting "PERL_ANYEVENT_DEBUG_WRAP=1" before starting your program). This will wrap every callback into an eval and will report any exception complete with a backtrace and some information about which watcher died, where it was created and so on. Author Marc Lehmann <schmorp@schmorp.de>. perl v5.14.2 2012-04-05 AnyEvent::FAQ(3pm)
All times are GMT -4. The time now is 02:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy