<tankfeeder>
they need his own copy for variables: I and R
<tankfeeder>
and need timeout to detect deadloop
<tankfeeder>
to stop both.
<Regenaxer>
hmm, sounds tricky
<tankfeeder>
as always.
<Regenaxer>
:)
<tankfeeder>
Finally, both programs try to rcv a fourth time, but no data is waiting for either of them, and they reach a deadlock. When this happens, both programs terminate.
<tankfeeder>
sounds like timeout function
<Regenaxer>
Well, not time but data is exhausted
<Regenaxer>
Each process could be a coroutine
<Regenaxer>
sending data with 'yield'
<tankfeeder>
ok
<Regenaxer>
At the moment it looks like the clearest way to me
<tankfeeder>
ok
<Regenaxer>
I don't really understand the task though
<tankfeeder>
task:
<tankfeeder>
Once both of your programs have terminated (regardless of what caused them to do so), how many times did program 1 send a value?
<tankfeeder>
can coroutines handle timeouts not to wait forever?
<tankfeeder>
Regenaxer: ^^^ ?
<beneroth>
tankfeeder, (abort)
<beneroth>
I don't know how well they mix with coroutines though
<tankfeeder>
ha
<Regenaxer>
Sorry, tels again
<Regenaxer>
If any of the coroutines says (bye), all stops :)
akkad has joined #picolisp
<Regenaxer>
Timeouts will not go well with coroutines, because if *one* coroutine sleeps thenn *all* sleep
<Regenaxer>
So control is passed with 'yield' between them
<aw->
beneroth: thank you sir
<beneroth>
your welcome, maestro
<tankfeeder>
if no timeouts then no coroutines.
<tankfeeder>
maybe pipe-task
<tankfeeder>
and udp to send-receive
<beneroth>
tankfeeder, use (tell) not udp
<tankfeeder>
ok
<beneroth>
picolisp parent process which does nothing beside (wait) (which also runs the message passing between child processes), and two child processes
<Regenaxer>
it is a logical sequence of events, right? Not "time" in seconds?
<tankfeeder>
not time
<Regenaxer>
yeah
<Regenaxer>
"simulated" time
<Regenaxer>
ticks or whatever
<Regenaxer>
So if one yield returns NIL, things stop?
<Regenaxer>
beneroth, more correct would be (tell Pid prog '(prinl "hi") '(prinl (version)))
<Regenaxer>
or (tell Pid 'prinl "hi") (tell Pid 'prinl '(version))
<Regenaxer>
for the local version it would be (tell Pid 'prinl (version))
<Regenaxer>
oops, the first is (tell Pid 'prog '(prinl
<tankfeeder>
snd X sends the value of X to the other program. These values wait in a queue until that program is ready to receive them. Each program has its own message queue, so a program can never receive a message it sent.
<tankfeeder>
rcv X receives the next value and stores it in register X. If no values are in the queue, the program waits for a value to be sent to it. Programs do not continue to the next instruction until they have received a value. Values are received in the order they are sent.
<Regenaxer>
ok, still I believe that coroutines are the most straightforward
<tankfeeder>
eh
<Regenaxer>
A coroutine alwads waits in 'yield' until some other coroutine calls it
<Regenaxer>
all with 'yield'
orivej has joined #picolisp
<aw->
beneroth: you here?
<Regenaxer>
A database looks like quite some overhead here
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
rob_w has joined #picolisp
aw- has quit [Quit: Leaving.]
<beneroth>
back
mtsd has quit [Quit: leaving]
<tankfeeder>
there is demo flow
<tankfeeder>
send, send, receive, receive
<tankfeeder>
two co cant work
<Regenaxer>
Coroutines are quasi-parallel, just as processes also are. On a single CPU processes also run one after the other
<Regenaxer>
(co ID (yield ID) ... calls itself, so it says "reentrant"
<Regenaxer>
(yield <val> ID) is needed too btw
<Regenaxer>
no, ok, understand
<Regenaxer>
but (yield N "1") is the problem if in "1"
<tankfeeder>
aaa
<rick42>
hola
<Regenaxer>
Hi rick42!
<rick42>
Hi, Regenaxer! :)
<rick42>
Regenaxer: i've been using http://ix.io lately for "pastebin" functionality. seems to be ok so far
<rick42>
has CLI \o/
<rick42>
well with curl
<Regenaxer>
Sounds good
<rick42>
:)
<Regenaxer>
What's wrong with pastebin?
<beneroth>
you were not happy with the line wrapping earlier :P
<beneroth>
ahoy rick42
<rick42>
beneroth: hi!
<rick42>
yes beneroth guessed it
<rick42>
i like the services that offer to paste something and when you go to retrieve it, it's just the text/content, no cruft around the content
<beneroth>
like, a static text file on your own webserver? :P
<rick42>
:D
<rick42>
yeah, for lasting things. for quick, transient things, these services are super convenient
<Regenaxer>
The line wrapping is not pasteibin's fault I believe, but of the one who formatted the text
<rick42>
ah
<Regenaxer>
Yes, "no cruft", so I always immediatel switch to "raw" to see the code
<Regenaxer>
But the above case was no code, but html I think
<rick42>
machine gened no doubt
<Regenaxer>
looks like
<rick42>
Regenaxer: sorry that i was bothered by the ML poster's video with the flashing lights. it was really bothersome (the lights). i still don't know why it was necessary
<rick42>
i was really hoping that they would still make vids but with the flashing lights :)
<rick42>
without*
<Regenaxer>
yeah
<viaken>
rick42: Thanks. I've been using http://sprunge.us. This should save a few keystrokes.
<rick42>
viaken: np. i use sprunge too!
<rick42>
viaken: sprunge was down for me a bit one day last week. so i switched to the other one. now i have both. :) please lmk if you know of others and i will add them to my "stable" :)