Hi Marc,
> So far, it seems everything works right. While EV is young and certainly
> has some bugs, it is used in a lot of projects, and really can't be
> _totally_ broken.
I never thought it was broken. If there was an impression as if I wanted
to express something like that, or even "totally
Hello Marc,
>> Then I run a simple loop in the debugger (on the same system), with just
>> one periodic watcher. Surprisingly, once started I could not interrupt
>> the loop via CTRL-C.
>
> That is interesting. I am not aware that solaris event ports would block
> any signals, and in fatc, I can
Hi Marc,
thank you for your long and detailed answer. Unfortunately I am in a
hurry these days, so sorry for the delay.
>> * For the interface, I like the named parameters interface of Event.
>> Of course this is a matter of taste (and performance), so this is
>> just a personal
Hi Marc,
two short notes, in a hurry: today I tried EV on Solaris 8 and found
that -lresolv needs to be added to the linker options in order to make
inet_aton() available. Perhaps this can be added to the default
configuration.
Then I run a simple loop in the debugger (on the same system), with j
> Here is my short test script:
>
Sorry, I copied a version with many watchers initiated via ..._ns()
methods. Of course intially these were the starting versions.
Jochen
Hi Marc,
thank you for EV and your detailed intro. I think it's great that you
are engaged in the improvement of event loops as you have a detailed
knowledge of related libraries and system calls and a great experience
in using the various loops. Although I did not have too many problems
with Even
Hello,
JNP> In your Event tutorial, you mention on using non-blocking socket
JNP> using IPC::LDT perl module. I try to use but encounter errors on
JNP> the receive. here's my snipprt code. I hope u can point out my
JNP> errors.
I don't know the errors that occurred, but here is a slightly rework
Hello, Brian,
BM> while ($$data =~ s/^(.*?\n)//) {
$self->>process_command($1);
BM> }
BM> That little regex in there is killing my performance. If one uses select,
BM> one must expect to read partial or multiple lines. That means that one must
BM> search for line terminators, and that
Hello, John,
JC> The timer watchers created are returned when I do a
JC> all_watchers(), but their callbacks are NEVER subsequently
JC> executed (even with PRIO_HIGH and a hardcoded short interval).
JC> Is there anything more I may need to do for the timers to be active?
you just have to build t
Hello, Tom,
> I am trying to build a network server that can take various requests
> from different clients, divide then into slices and process the
> slices on a first come/first served basis but im having difficulty
> with it. I am using an IO event watcher to check for new data on the
> socket
Hello, Jeff,
> Supposedly, this module offers ways to control and optimize code based
> on Event.pm. However, my shallow dip into the documentation didn't gain
> me any insight as to how to set it up. Can anyone offer a quick how-to?
please try the following:
* Add the lines from the NetServe
Hello, Angelo,
> I tried the multiclient server example provided with Event.pm... works
> great except that if I kill (ctrl-c) or exit the client... the server
> dies/exits as well.
>
> Any thoughts?
unfortunately the example does not check if a connection was closed. It
continues to read, and a
Hello, Jeff,
> What I'm wondering is whether Event->io does anything differently if you
> supply min and max versus if they are omitted.
all watcher types share several "base" attributes, but min and max are
"extra" attributes that are *not* provided in general. As for io watchers,
they are *not
> OK, it seems that Devel::Leak::CheckSV() is intended to be a one shot call. The
> script continues to work if Devel::Leak::NoteSV() is called after each CheckSV().
>
> The reported number of SV's remains constant from the 2nd callback invokation on.
> However, memory consumption grows *rapidly*
> I tried to add traces to your script but they made it hang
> completely (no activity after the 2nd or 3rd call of CheckSV() , verified by
> truss).
OK, it seems that Devel::Leak::CheckSV() is intended to be a one shot call. The
script continues to work if Devel::Leak::NoteSV() is called after e
Hello, Bradley,
> Agreed, more testing will need to be done. However, it does appear to be
> some type of interaction caused by Event.pm.
I'd agree that it looks like this, but of course it needs to be investigated. Did
you succeed with Devel::Leak? As I noticed that one of my scripts grew up f
Hi, Brad,
unfortunately I'm in a hurry so I cannot try your updated script today,
but nevertheless a first impression:
> However, now having said that, I am going to really
> confuse you (I'm already confused). I changed the basis
> of the script to use sysread() (which is what my main
> script
> Hardware: Sun Ultra-10
> OS: Solaris 7
> Perl ver: 5.6.1
> Event.pm ver: 0.85
Same under Solaris 5.8 with perl5.6.1 and 5.00503, and Linux 2.2.16 with
perl5.6.1 and 5.00503.
Jochen
> Second, I rerun your script. After a pure runtime of about 15:00 minutes
> according to top, it grew from about 3 KB to 19 MB memory consumption.
> (Interestingly, it still reserves about 8 KB only.)
Sorry, this should have been 3 MB and 8 MB (not KB).
Jochen
Hello, Bradley,
> Was wondering if anyone could shed some light on a problem that I am having
> with a memory leak issue.
while I not have a solution, at least I can endorse your assumption.
First, we are running several such 24/7 Event jobs for years, too. These are
clients and servers using l
Hello, Mark,
> What I want to do is read data from a growing file (tail -f) until a special
> record arrives, at which point I would like to close the file and reopen
> another one repeating the process.
there is a module called Event::File which implements tail -f the Event way.
Hello, Bruno,
> What i was looking for was a timoutmechanism to close idle sessions in a
> script... From the description i think that the Event module is suited,
yes, Event is well suited for this purpose.
> i made the following testscript:
>
> #!/usr/bin/perl -w
> use Event qw(loop);
> requi
Hello, Uri,
> has anyone gotten IO::Socket::SSL to work under event.pm?
yes, we're running server and clients on base of this combination for years.
Here is the clients (simplified) init sequence:
# make the underlaying Net::SSLeay module quiet
$Net::SSLeay::trace=0;
# load the SSL m
Hello, Vincent,
> I tried to install Event perl module from Event-0_01_tar.gz
this version number looks out of date. Please try Event-0.83.tar.gz. It can be found
at http://search.cpan.org/search?dist=Event.
Jochen
Hello, Raul,
>1 - Create a timer watcher with a high period (e.g. 60)
>2 - Create it parked, so it won't run
>3 - the $watcher->interval; reports 60.
>4 - set it to lower value (e.g. 1) $watcher->interval(1);
>5 - the $watcher->interval; reports 1 (as expected)
>6 - start the watcher $watcher->st
Hi, Marc,
>first of all, is this dead, or is everybody on vacation? ;)
I dont't think this list is dead. My experience is that it is rather
silent until a question comes up, which then usually causes a related
discussion. Additionally, Joshua is travelling now and has no permanent
mail access. I
Hello, Marc,
>It seems that Event installs a typemap, but Event::MakeMaker does not
>reference it so extension modules can't use these types (without manual
>work). Is this just an oversight or must I use my own typemap?
as far as I know, Events typemaps are especially prepared for use with
Inli
Hello, Jeff,
>I've got two timer events with the same interval but different callbacks.
>One of them gets called, and runs for a time longer than the interval. The
>other never gets called.
I cannot reproduce this behaviour. Could you please send (simplified?)
example code?
I did the followi
Hello, Marc,
> I'd be very much interested in other platforms (e.g.
> windows, other unix
> flavours) because multithreading on the c level is not
> that portable.
this afternoon I tried both Coro 0.08 and 0.1 under Solaris (various
versions) with perl 5.6.[01]. In all cases it turned out t
Hello, Jeff,
>I was trying to reset the 'data' attribute for an 'idle' event.
>Specifically, the event got created without the 'data => $anything'
>attribute, and I'm trying to add it later. [...]
>Here's my code:
>[...]
>$event->configure( data => 'foo' );
please use data() to modify the data
Hello, Danny,
> Is Event the best choice to recommend for event-driven programming? I
> see that there's also the EventServer module - but given that it hasn't
> changed in a few years, can we assume that it's obsolete? I also see
> that POE looks like a viable choice. It seems to be more comp
Hello, Jim,
> Same failure when trying the example from pages 19-20 in the .pdf doc ... perhaps
>the module has a problem with Solaris?
I agree with you that this is an installation problem, but I doubt that it is caused
by Solaris in general. Your first message (quoted by Joshua) showed me th
Hello,
>>I'm trying the Event module ... starting out with an early example
>>cut&paste (I changed trhe #! line) from the pdf doc. It is not finding
>>Event/all_watchers.pm
I'm not sure what's going on ... I copied the script from the mail, and
it run out of the box on my Linux box with Event 0
Hello, Alex,
> my $ldt=new IPC::LDT(handle=>$socket, objectMode=>1);
> ($msg) = $ldt->receive or (print $ldt->{'msg'} && exit
> 1);
this code looks good.
> This code is called from an Event 0.81 io watcher, and
> $socket is $event->w->fd.
Well, this *should* work, but honestly spoken I ne
Hello, Uri,
> Event.pm v0.80
same here
> # uname -a
> SunOS zzz.zzz.com 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-5_10
# uname -a
SunOS name 5.7 Generic_106541-10 sun4u sparc SUNW,Ultra-5_10
Almost equal, except of the kernel jumbo patch. Let's see, we have a system
with kernel jumbo patc
> JS> Which version of Solaris do you run?
>
> solaris 7 and linux 2.2.16-3
This is mysterious. I just rerun the tests on Solaris 2.7 (with perl5.00503)
and could perform them successfully.
> i can't grok the test code to see what test 5 is. it seems to
> dynamically generate the test number
Hello, Uri,
> just updated to event .80 on both solaris and linux. they both show a
> failure of test 5 of the callback tests.
hm, it passes all tests here on Solaris 5.6 with both perl5.005 and perl 5.6 ... is
there something special on your platform? Which version of Solaris do you run?
>For what it's worth, i decided to change the prototype to:
>
> (* (void(*)(pe_event*)) ev->callback)(ev);
Great!
>i wasn't and am not considering performance at any point in this thread.
>The concern here is whether the C & Perl APIs can match, from the point
>of view of the naive developer.
And for this match it is an advantage that Inline wraps around the
complete call so that we finally have both the wr
Hello, Matthew,
>> if a multiclient single process server is a choice, I could provide a
>> general example from the next tutorial version which shall provide more
>> example code.
>That would be helpful.
as I saw in the list you're already on the way to set up your server. I
hope the attach
Hello,
>> Since my project will be TCP client/server in
>> nature, ...
if a multiclient single process server is a choice, I could provide a
general example from the next tutorial version which shall provide more
example code.
Jochen
Hello, Marc,
this works:
- snip --
use Event;
die "Usage: $0 \n" unless @ARGV and -e $ARGV[0];
my $fh = do { local *GLOB };
open $fh, "<", $ARGV[0] or die $!;
print "fileno: ", fileno $fh, "\n";
print "asstring: $fh\n";
# here is the difference
Event->io(fd=>\$fh, cb=>\&callback);
Event::l
Hello, Uri,
>so if anyone is using (or knows of a project using)
>event.pm in a 24/7 role, please tell me how it is going.
I wrote a complex client/server system on base of Event which is
explicitly designed to run constantly. It uses a significant number of
dynamically made, registered, mainta
Hello,
> > sub handle_client {
> > my $event = shift;
> > $event->w->private->accept();
> > }
> >
> > I want to be able to pass $socket to handle_client().
> > I though i would use private to do this.
>
> Try using the data() attribute instead of private().
in my opinion, the soc
Hello, Gaal,
> Has anyone done work on writing a "transport" module for messages with
> Event.pm?
I wrote IPC::LDT (see CPAN) exactly for this purpose. It is not built on
base of Event but intended to well cooperate with it. All communications in
my own event driven client/server implementations
>How about if I rename the new implementation of data() to private()
>How about if I rename the new implementation of data() to private(),
>and then reimplement data() without the fancy caller() trick? Would
>that satisfy all parties?
Yes, this would be a good solution, clear and flexible.
Jochen
Hello,
> Sure, except that it is not easy to determine the correct package from
> inside Event::Watcher::init().
This could be avoided by a global data attribute but well ... I read the discussion of
yesterday again and understand somebody
could have a need for package specific data storage. We
Hello,
thanks for this new release. One remark: it is possible to say now (debugger session):
DB<1> $io=Event->io(parked=>1, data=>[qw(a b c d)])
DB<2> x $io->data
0 undef
DB<3> $io->data([qw(a b c d)])
DB<4> !2
0 ARRAY(0x23e444)
0 'a'
1 'b'
2 'c'
3 'd'
Tha
Hello,
in a client/server system running on base of Event, I check for closed
connections and remove all related data from the server process, inform
other related clients and so on. This is done via an io read/error event
watcher. The callback calls a function that first of all checks the
handle
> Well, 32 handles is probably enough for many simple scripts and many
> applications. Servers are a different story.
I've heard about a client connected to several hundred servers ... Hm, this is
probably untypical. In my opinion, a limit of 64 is really hard, but surely this
would be a beginni
> Contributors:
>
> ...
... and, if I understood it right, a person who is willing to invest his
time.
Jochen
> Fixed. See 0.73.
Great! I'll try it. Thank you!
Jochen
Hello,
I just installed perl 5.6 and tried to reinstall Event 0.72. It hangs in
the loop test. Here is what it says with activated traces:
- snip --
t/loop..creating Event::idle desc='early'
Event::Watcher::init('Event::idle=HASH(0x1a11ac)',
'HASH(0x3cfdac)') called at blib/
> Are you talking about streams? I_SETSIG causing SIGPOLL?
Ah! Somebody who has probably heard this as well.
> ... You could actually say "whenever data comes
> in through the stream head attached to file descriptor blah (ioctl
> I_SETSIG), cause the kernel to SIGPOLL me with the details.
This
Hello,
the following code is the main part of an example prepared for the workshop, emulating
"tail -f":
- snip --
# install "tail -f"
Event->io(
fd=>\*IN,
cb=>sub {
# check for real news
return if eof(IN);
# read ne
> > One person knew a new UNIX kernel mechanism which actively - if I
> > understood and noted this correctly - can inform processes when certain
> > handles are used. He asked if Event supports this mechanism.
>
> Show me a man page. :-)
I asked for this immediately (last week) and will send
Hello,
just a (hopefully ;-) short report of Event presentation at the conference. Actually
there were two talks about the module. I first introduced basic concepts and usage.
This was a compact version of the tutorial presented in about 45 minutes. I tried to
point out that event driven progr
> Can you compare/contrast with Event-tcp?
This is difficult because I did not use Event::tcp yet. I discovered it in
version 0.07 and load down that release. Honestly spoken, this time I already
had IPC::LDT. I found that Event::tcp was not exactly what I need for my
system so I did not install
Hello,
this mail is NOT about Event directly but about a related module. I just want to
inform you because I think it could be of interest for other Event users as well.
This weekend I published a module on CPAN which I developed for my current
client/server system (which is built on base of E
> > Here's a fix:
>
> Thank you. I cannot apply it here but will do this later on Linux.
I tried it now, and it works well. The error disappeared.
Jochen
Hello,
> I don't understand.
Because it works right. You've my apologies for my confusing question! When I typed
in something while repeat was set to 1, of course the watcher should remain active.
Jochen
> Here's a fix:
Thank you. I cannot apply it here but will do this later on Linux.
Jochen
> Maybe you can get a C-level stack trace?
I attach the debug session log. I forced program termination by a conditional dump()
in a $SIG{__WARN__} hook. The calling condition was "Event.pm" in the message.
Jochen
debug.repeat
> I don't understand.
I'm in a hurry now but I will try to explain this later.
> Can you post the output? This sounds like a real bug...
I attach it. This output was produced with your script on Linux. Imagine the last line
again and again (I truncated the file ;-) I enforced this result by p
Hello,
I was talking with another programmer about Event, and we came to a
point where he asked me if repeat(0)/repeat(1) is synonym to
stop()/start(). This seems to be underdocumented, so I wrote this hack
to check it:
- snip --
use strict;
use Event;
my $w=Event->io(fd=>\*STDIN, repeat=>0,
Sorry,
> It seems to me he opened the script
I meant "the file"
Jochen
> I'm confused. Do you expect the file to be created by this script?
It seems to me he opened the script to get a handle to watch. Then he
watched this handle for writing to detect if another process wrote to the
file connected to this handle. This cannot work because the handle
represents this
Hello,
because of design tasks, I did not use 0.67 in my application before.
Now I did and got these messages:
- at startup: Use of uninitialized value at .../Event/Watcher.pm line
79.
- at startup and in every loop: Use of uninitialized value at
.../Event.pm line 145.
The second warning seems
> > $groupWatcher->add(\$groupWatcher);
> >
> > in a script. But if I do this in the debugger, my Linux perl crashes
> > with a segmentation fault.
>
> That's strange. Can you post a stack trace?
Hm, I confess the reference usage was wrong! Anywhere else references, but
these are objects (just c
Hello,
> + * Fix bomb in group watchers.
just a success note: it passes the test on Linux now, too. Well!
Another thing was fixed as well, so I can no longer say
$groupWatcher->add(\$groupWatcher);
in a script. But if I do this in the debugger, my Linux perl crashes with a
segmentation fault
Congregulations! It works.
Thanks
Jochen
Hello,
now, here are the results. You were right, it seems to correlate with perls thread
support on Solaris:
- a perl without thread support runs the script;
- a perl with thread support receives SIGBUS while running the script.
Cores may be dumped or not. The SIGBUS signal immediately termina
> Maybe! Can you compile Event with -g and run it in the debugger?
Ok. It may take a while because I have to build a debugging perl first (no
difference under debugger control with -g in Event alone).
Jochen
Hello,
> I recompiled with Insure++ and found this (fix attached):
I patched watcher.c and reinstalled Event, but (here on Solaris) the script
still dumps a core.
> However, I couldn't find anything else.
Hm. Do you think a stack trace could help? As truss showed, the script is
terminated by S
> I've had servers
> in production that start crashing and alert the user. Then I go in with
> ProcessTop and, without restarting, work around the problem. The user
> is impressed.
So do I! And I was already impressed by ProcessTop itself. Just to mention it in the
talk (and because of my curi
Hello,
> I didn't have any problems with 5.5.3 either. Maybe you are getting
> hosed by threads.
I don't think so. I checked the scripts on Linux where I run a non threading perl (I
attach the perl -V output). Different to Solaris, the coredump script does NOT produce
a coredump, but it is te
Hello,
two slight suggestions for group watchers. Accidentally I wrote:
$groupWatcher->add(\$i);
where $i was still unused (of course, in a hack without "use strict"). This causes a
segmentation fault.
Being on this way, I tried:
$groupWatcher->add(\$groupWatcher);
which produced the messag
> + scalars. ([EMAIL PROTECTED] is too creative)
;-)
Hi,
what a surprise:
> + * Group watchers for watching watchers.
Great! I will check out this tomorrow morning, and there is a real chance that I will
use this feature before afternoon ;-). I assume. Surely they are a good idea. I'm not
sure how quick I can condense my application context int
Hm, it seems now clearer to me and to be no error: my modifying timer did
this:
- it incremented the variable by the ++ operator: one read, one write: 2
accesses;
- it compared the variable with a number: 1 read access.
So there were three access events (poll was set to "rw"). Ok, one has to be
Hello,
here comes another script. It installs a number of var watchers and then
modifies the variables. As you can see in comments, this was intended to
become another grouping test script, but the error has to do with var
watchers: whenever I modify a certain variable, the associated watcher is
Hello,
watcher priorities control which watcher is activated first if two
events occur simultaneously. But is there an determined order if there
are watchers with the same priority?
Example: two watchers are made to watch the same variable. A is made a
second before B, both with the same priorit
> How's this?
Concise ;-) I think it is ok.
> Eh? Which join are you talking about?
Hm, did I misunderstand your research result? I will read it again.
Jochen
> "statement" is a vague word.
Well. Seems I meant "operations".
> I think most perl o_ps_ will (in the absence
> of ties or other C-level magic) only write it once. You cannot
> tell what XS code might do, or ties.
O, of course.
Jochen
Hello,
are there limitations in the type of variables or accesses var watchers
can check?
I tried to watch the deletion of a hash element. This did not work
regardless if I watched the complete hash or the element itself.
If I watch a complete hash, element modifications are not recognized.
If
> Well, some sort of test for the test suite would suffice. The code
> isn't really finished so I'm sure you'll be feeling the rough edges soon
> enough.
Hm, I got a (reproducable) core dump in first tests. Then, surprisingly, after
a slight restructuring, the script behaved as excepted. I attac
> > > If I watch a complete hash, element modifications are not recognized.
> >
> > Correct.
>
> The is because you are modifying the SV held in that element. Perl does
> not consider this a modification to the hash itself.
Ah ... I see. But what about delete() (and adding a new element)? scalar(
> Var watchers generate events when the given variable is read from or
> written to. As perl is a concise language, it is often difficult to
> predict when a variable will be read. For this reason, variable
> watchers should poll for writes unless you know what you are doing.
O, and ple
> I got rid of clump (except for signals). Why do you need it for var
> watchers?
Well, as we saw, a single perl statement can be translated into a number of internal
accesses. But my intention to write a watcher is to get informed if, lets say, the
variable is modified. I want to get informed O
> It sounds like I need to add a filter to restrict var watchers to plain
> vanilla scalars. Do you need more flexibility than that?
Honestly spoken, these hacks were final preparations to watch a number of multi
level data structures by combinations of var and possibly group watchers. These
str
> FIFO.
Ok.
> I added the attached test and updated the documentation.
Thanks!
Jochen
Hello,
what is the meaning of the all_idle() class method? Maybe it's obvious,
but I cannot really imagine what the "idle queue" is.
Thanks in advance
Jochen
Hello,
I'm just preparing my introduction of Event to the German Perl Workshop. That's why
I'm collecting (short descriptions of) applications built on its base to mention them
as usage examples. So what is/was this module used for?
To start, I'm currently implementing client/server systems fo
> This restriction can be
> relaxed in a future release if there is enough demand.
As you surely expected ;-), the first demand just arrived with this message.
Jochen
> They are implemented with perl's MAGIC. My experience is that MAGIC has
> a very small performance impact. Have you used TIEXXX? Var watchers
> are faster than TIE.
Ah, that sounds good. By the way, is this special magic the reason of the
restriction that there can be only one var watcher fo
> Gee, I suppose you'll be requesting var watcher timeouts shortly...? :-)
How do you know ... ??? ;-)
Jochen
Hello,
what about the costs of var watchers? I'm thinking about a slight
redesign of my application which would include a lot of them (made and
destroyed dynamically) running simultaneously. I'm asking because usual
debuggers are often slowed down EXTREMELY if variable watching
breakpoints are se
> Done.
Thanks!
Jochen
> My thinking was that C requires less
> knowledge of internals than C. With C, I can think about
> increasing or decreasing priority without worrying about the exact
> numeric priority.
In my opinion, this is true if you have a certain watcher running and want to change
its priority. Then it's
1 - 100 of 133 matches
Mail list logo