r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 GUI]

Gregg
1-Mar-2010
[984]
Right. It seems that it's overhead in WAIT.
Cyphre
1-Mar-2010
[985]
Gregg, yes in R2 it looks the resolution that can be measured under 
Windows is ~10ms and you start to burn your CPU at 100% when you 
WAIT 0.0001 which means in R2 the same as WAIT 0.
Gregg
1-Mar-2010
[986]
Right. I thought maybe R3 had an artifact of that, but it doesn't 
seem so. CPU use goes up as you decrease the wait time, there doesn't 
seem to be a magic threshold.
Cyphre
1-Mar-2010
[987]
Gregg, yes it looks like that...either there is some bug in WAIT 
or WAIT is not letting CPU to get IDLE state anymore from some reason.
Gregg
1-Mar-2010
[988x2]
Agreed.
The only possibly related thing I can find is http://curecode.org/rebol3/ticket.rsp?id=379&cursor=30
Cyphre
1-Mar-2010
[990]
I think the OS_Wait() function in Host kit could give us some answer. 
I'll try to recompile with some debug info....
Gregg
1-Mar-2010
[991x2]
Is a simple LOOP with a WAIT in it enough for the bug report?
Ah, OK. That sounds good.
Steeve
1-Mar-2010
[993]
Are you Guys using wait , instead of time events in your GUI ?
Cyphre
1-Mar-2010
[994]
yes,  the above discussion is wait command inside loop.
BTW what time events you mean?
Steeve
1-Mar-2010
[995]
like in R2 the time events generated by the rate propertie
Cyphre
1-Mar-2010
[996]
AFAIK there is no RATE in R3. Or am I missing something?
Steeve
1-Mar-2010
[997x2]
there's no rate but you can generate time events aswell
not documented though
Cyphre
1-Mar-2010
[999]
you mean like make event! [] right?
Steeve
1-Mar-2010
[1000x2]
yep
but constructing an event is not enough, you have to know where to 
push it :)
Cyphre
1-Mar-2010
[1002]
ok, but even if you generate own events you need to WAIT at some 
point so the CPU is not at 100% no?
Steeve
1-Mar-2010
[1003x3]
no, it depends of the duration of the process triggered by your events, 
if it takes too much time, it will froze the CPU obviously.
i have not made tests so far actually
just guessing
Cyphre
1-Mar-2010
[1006]
can you post any example if it is not too big?
Steeve
1-Mar-2010
[1007x2]
i could, perhaps tomorrow, i have not the source at my home.
The principle is simple.

At startup, I build an event time!, the I push it in the block located 
at system/view/event-port/state.

And In my global event handler, each time I receive this event, I 
repush it immedialtly in the queue.

I receive 1000 time! events per seconds in My tests, but it mights 
depend of the speed of your UC
Cyphre
1-Mar-2010
[1009x2]
ok, no hurry...I'll also try to play with it later.
hmm, I pushed event into the event-port/state but nothing happened 
here. the event is still there and was not send to my global handler.
Steeve
1-Mar-2010
[1011]
did you do a do-events ?
Cyphre
1-Mar-2010
[1012]
yes, tried both do-events or just calling VIEW
Steeve
1-Mar-2010
[1013]
i will post it tomorow, it tried only on XP
Cyphre
1-Mar-2010
[1014]
is that some new feature? I'm using 2.100.97.3.1 release under Win 
XP
Steeve
1-Mar-2010
[1015x2]
i don't think so, actually it's a trick i discovered accidentaly. 
I don't thing Carl thought about it
i used 97 too
Cyphre
1-Mar-2010
[1017]
do I need to set the event properties in some specific way?
Steeve
1-Mar-2010
[1018]
i just made
make event! [type: 'time port: port-event]
(yes you need to add the port-event, if not it doen't work)
Cyphre
1-Mar-2010
[1019]
doesn't work here even if I put the reference to event port inside 
the event
Steeve
1-Mar-2010
[1020x2]
Hmm... i will post my complete test then.
How did you created the port-event ?
Cyphre
1-Mar-2010
[1022]
I just put there reference to system/view/event-port
Steeve
1-Mar-2010
[1023]
event-port: system/view/event-port: open event:// 
And then you added you handler at  port-event/awake
right  ?
Cyphre
1-Mar-2010
[1024]
I'm using the official init-view-system so the sequence looks like:
init-view-system
p: system/view/event-port

insert system/view/event-port/state ev: make event! [type: 'time 
port: p]
...
Steeve
1-Mar-2010
[1025x2]
by default there is nothing at system/view/event-port
Hum ok, i don't use it because i don't like it, i do my own ;-)
Cyphre
1-Mar-2010
[1027]
yes, but try: source init-view-system
this is a shortcut for creating the event-port
Steeve
1-Mar-2010
[1028]
i takes one line to make it
Cyphre
1-Mar-2010
[1029]
I want to be compatible with VIEW so I'm using the system handler. 
But anyway, this shouldn't make any difference no?
Steeve
1-Mar-2010
[1030x2]
hum ok, it should not be a burden
no, i see no difference
Cyphre
1-Mar-2010
[1032]
unles you are using some 'special' handler :)
Steeve
1-Mar-2010
[1033]
We will see :-)
But obviously there is something different cause it works here