View event loop broken? Was: Re: [Fwd: Re: Rugby bug-report]
[1/4] from: maarten::koopmans::surfnet::nl at: 18-Jun-2003 20:23
All,
I looked into my code and it doesn't do anything strange or tricky, it
just initializes some blocks and uses a server port in no-wait mode.
It looks like the View 1.2.10 event loop causes problems combined with
launch. At least on Linux.
I'll send it to feedback. OTOH: 1.2.10 was the basis for View 2.0? SO
under the hood something has changed....
--Maarten
[2/4] from: nitsch-lists::netcologne::de at: 20-Jun-2003 15:13
Found Bug. Was: Re: View event loop broken? Was: Re: [Fwd: Re: Rugby bu
Bug:
When using launch and then wait on a port, /views event-loop freezes
when launched script quits..
Because:
A terminating process sends a unix-signal,
and that interrupts wait.
The signal can be found in system/ports/system.
Also wait returns the first port in the block.
this block is marked as "has content",
which is cleared by 'pick or 'first.
A 'do-events / wait without ports is not interrupted.
Bug-Demo:
[REBOL [Title: "launch-wait-bug demo"]
save %test.r [rebol[] alert "test" quit]
launch %test.r
port: open/no-wait tcp://:8002
probe wait port
print "interrupted"
probe pick system/ports/system 1
;now this hangs
con: first port
print "got connection"
;will print
;interrupted
;[child 13026 0]
]
Workaround:
give a dummy-port port as first argument.
But pick on it blocks.
Trick: system/ports/system, the system-port, works.
like
data-on: wait [system/ports/system real-port]
if not same? data-on system/ports/system[
;we have data
]
;patched-wait:
;drops launchs signal.
;bug: also all others on system/ports/system
;does not support /all yet.
patched-wait: func[ports /local data-on][
forever[
data-on: wait head insert to-block ports system/ports/system
either same? data-on system/ports/system[
probe pick system/ports/system 1 ;clear event
][
return data-on
]
]
]
Tested on:
/view 1.2.10.4.2, suse 8.0
-Volker
[3/4] from: maarten::koopmans::surfnet::nl at: 20-Jun-2003 16:32
Re: Found Bug. Was: Re: View event loop broken? Was: Re: [Fwd: Re: Rugb
Reported to feedback?
--Maarten
Volker Nitsch wrote:
[4/4] from: nitsch-lists:netcologne at: 20-Jun-2003 18:21
Yes, (Feedback Id #36k615090)
-Volker
Maarten Koopmans wrote: