<Regenaxer>
Strange! Seems I wrote that, but I don't remember at all!
<tankf33der>
atomic.l is copy from you rosettacode.l file
<tankf33der>
both yours
<Regenaxer>
This line is missing:
<Regenaxer>
(call 'rm "-f" "buckets.db") # Remove old DB (if any)
<Regenaxer>
So it creates more and more objects
<Regenaxer>
I have here what I wrote in rosetta back then
<Regenaxer>
It is identical, just the (call 'rm "-f" "buckets.db")
<tankf33der>
i modify it to pool-tmp
<Regenaxer>
Ah, ok!
<beneroth>
pool tmp is nice
<Regenaxer>
yes, this is good
<Regenaxer>
But I really wonder why I put (dbSync) around the printing
<Regenaxer>
Perhaps to get the whole DB locked
<beneroth>
but (seed (usec)) is probably better than (seed *Pid), no? because *Pid might be guessable (with OS access)
<Regenaxer>
So that a consistent state is read
<Regenaxer>
makes sense
<Regenaxer>
Otherwise the data are modified while the list is read
<Regenaxer>
and the sum may differ
<Regenaxer>
Hi beneroth
<Regenaxer>
yes, but this is not a security issue here
<beneroth>
hi Regenaxer, hello tankf33der :)
<beneroth>
T
<tankf33der>
seed is not problem
<Regenaxer>
Just for the test data
<tankf33der>
problem why it doesnt print lines
<tankf33der>
or prints with 20min gap
<Regenaxer>
Here it prints
<beneroth>
whats best practice for read transactions? (dbSync) + (rollback) ? but rollback wipes, not desired in every case. (dbSync) + (commit) might also be suboptimal, no?
<beneroth>
(I'm off-topic)
<Regenaxer>
might be fine, as no data are modified
<Regenaxer>
Except here I *never* locked before reading
<beneroth>
reading a single external symbol is atomic, no? or only reading a single block?
<Regenaxer>
no, the whole symbol, all its blocks
<beneroth>
ok, thx.
<beneroth>
then I got it right.
<Regenaxer>
What I don't understand now is why it does not wait for 2000 msec
<Regenaxer>
How can that be?
karswell_ has quit [Remote host closed the connection]
karswell_ has joined #picolisp
<Regenaxer>
afp
<Regenaxer>
ret
<Regenaxer>
Hmm, something must be wrong
<Regenaxer>
I reduced it to:
<Regenaxer>
(pool (tmp "db"))
<Regenaxer>
(unless (fork)
<Regenaxer>
(loop
<Regenaxer>
(dbSync)
<Regenaxer>
(commit 'upd) ) )
<Regenaxer>
(unless (fork)
<Regenaxer>
(loop
<Regenaxer>
(println (inc (0)))
<Regenaxer>
(wait 2000) ) )
<Regenaxer>
(wait)
<Regenaxer>
<Regenaxer>
And: The (wait 2000) does *not* wait!
<Regenaxer>
On Intel/AMD
<Regenaxer>
On Arm64 Android it waits
<Regenaxer>
f***
<Regenaxer>
If I remove the 'upd it waits
<Regenaxer>
So the wait seems interrupted by the IPC
<tankf33der>
centos and archlinux both pils waits on -v3.l file
<Regenaxer>
means they work correct?
<tankf33der>
just waits
<tankf33der>
waits = 2 secs
<Regenaxer>
ok
<Regenaxer>
So what we know is: One process keeps IPC and the parent very busy
<Regenaxer>
Still I don't understand why the wait does not wait
<Regenaxer>
I must receive some event
<Regenaxer>
an error perhaps?
<tankf33der>
unknown
<tankf33der>
maybe richard stevens knowns ? :/
<Regenaxer>
no, in pil
<Regenaxer>
Some pipe error or so which is not correctly handled
<tankf33der>
pil64 only?
<tankf33der>
right
<Regenaxer>
You said you saw in pil32 too
<tankf33der>
yea, archlinux
<Regenaxer>
Both should have the same logic here
<tankf33der>
ok
<Regenaxer>
ok
<tankf33der>
maybe it possible repeat on raw C first ?
<Regenaxer>
How? Stand-alone C program?
<tankf33der>
yea
<Regenaxer>
it needs all IPC from pil
<Regenaxer>
long waitFd(any ex, int fd, long ms)
<Regenaxer>
this function and a lot of related funs
<Regenaxer>
So quite a big job ;)
<Regenaxer>
I think I found it
<tankf33der>
:)
<Regenaxer>
Not happy
<tankf33der>
its ok
<Regenaxer>
nope
<tankf33der>
what you found ?
<Regenaxer>
hard to explain
<tankf33der>
is patch ready ?
<Regenaxer>
haha! I don't even know what to do yet
<tankf33der>
but you found it
<Regenaxer>
It is the select() system call
<Regenaxer>
well ...
<Regenaxer>
man 2 select
<Regenaxer>
it says in Linux: "On Linux, select() modifies timeout to reflect the amount of time not slept"
<Regenaxer>
I'm using this value
<Regenaxer>
ever since, in pil32 and pil64
<Regenaxer>
But it seems not correct
<Regenaxer>
too big
<Regenaxer>
600 msec
<Regenaxer>
if the processes are very busy
<Regenaxer>
So the 2000 ms are very quickly gone
<Regenaxer>
decremented a few thousand times per second with too high values
<Regenaxer>
in @src64/io.l is:
<Regenaxer>
? (= *TargetOS "Linux") # Linux?
<Regenaxer>
ld A (L -V) # Seconds not slept
<Regenaxer>
ld E A
<Regenaxer>
mul 1000 # Calculate milliseconds
<Regenaxer>
div 1000 # Calculate milliseconds
<Regenaxer>
ld A (L -IV) # Microseconds not slept
<Regenaxer>
add A E # Milliseconds not slept
<tankf33der>
eh
<Regenaxer>
in pil32 :
<Regenaxer>
#ifdef __linux__
<Regenaxer>
t -= tv.tv_sec*1000 + tv.tv_usec/1000;
<Regenaxer>
#else
<Regenaxer>
That's why it works on Android!
<Regenaxer>
*TargetOS is not "Linux" but "Android"
<Regenaxer>
So this value seems too high:
<Regenaxer>
ld A (L -IV) # Microseconds not slept
<Regenaxer>
If I force it to the non-Linux select() behavior, the sleep times are much longer
<Regenaxer>
3 or 4 secs
<Regenaxer>
50088 1
<Regenaxer>
3 4
<Regenaxer>
4 2
<Regenaxer>
4 3
<Regenaxer>
4 5
<Regenaxer>
4 6
<Regenaxer>
4 7
<Regenaxer>
3 8
<Regenaxer>
because the process is so busy processing the stream of 'tell' messages
<tankf33der>
hm
<Regenaxer>
Depends on things like how many cores perhaps
<Regenaxer>
This code example is kind of extreme, normally not happening in real world
<Regenaxer>
But it shows the problem
<Regenaxer>
OK, so I better abandon this special Linux behavior
<Regenaxer>
I always thought it is a big advantage, as it avoids two time system calls per select() call
<Regenaxer>
But if it is soooo inaccurate ...:(
karswell_ has quit [Remote host closed the connection]
karswell_ has joined #picolisp
<tankf33der>
i will test different linuxes when released
<Regenaxer>
*If* I change it this way, then all OSes are the same
<Regenaxer>
at the moment only Linux is treated specially
<tankf33der>
thats why i will test only linuxes
<Regenaxer>
yeah
<Regenaxer>
OK, did it
<Regenaxer>
I hope this is a good idea
<Regenaxer>
Changed also in pil32, can you check that too? (I have no 32~bit system corrintly)
<tankf33der>
i will check
<Regenaxer>
Thanks!
<Regenaxer>
Here all seems to work so far
<Regenaxer>
both on Android and Debian
<beneroth>
interesting. deep issue.
<Regenaxer>
indeed
<Regenaxer>
it is an extreme case
<beneroth>
thanks Regenaxer for looking into this :) you are so quick!
<Regenaxer>
total stress test for pil ipc
<Regenaxer>
I'm a bit unhappy
<beneroth>
so whats the bad taste of the change?
<beneroth>
overhead, extra calls?
<Regenaxer>
I thought this was a good feature of select() in Linux
<Regenaxer>
yes, to gettimeofday calls needed
<Regenaxer>
for each select
<beneroth>
how is this feature then used normally, if one can't trust it the way you used it, I wonder...
<Regenaxer>
But most surprising is that the returned values are too high
<beneroth>
underflow?
<Regenaxer>
Not sure
<Regenaxer>
The difference of two gettimeofday calls is fine
<Regenaxer>
I think in this test case select() *never* slept at all
<Regenaxer>
because the other process was bombarding it with so many messages
<Regenaxer>
but it did not return zero
<Regenaxer>
or near zero
<tankf33der>
what about atomic.l now
<tankf33der>
both archlinux and centos doesnt print
<tankf33der>
as i remember some of them print yesterday
<Regenaxer>
hmm, another problem then?
<Regenaxer>
On Debian, if (dbSync) is commented, it works
<beneroth>
On Linux, select() also modifies timeout if the call is interrupted by a signal handler (i.e., the EINTR error return). This is not permitted by POSIX.1-2001. The Linux pselect() system call has the same behavior, but the glibc wrapper hides this behavior by internally copying the timeout to a local variable and passing that variable to the system call.
<tankf33der>
09:57 <tankf33der> archlinux pil32 and pil64 works
<tankf33der>
09:57 <tankf33der> centos 7 pil32 and pil64 no output.
<Regenaxer>
Srini, what do you think? Would it make sense if I include lib/pdfPage.l and misc/pdfPage.l into the standard PicoLisp distribution?
<Regenaxer>
Or is it too specialized?
<tankf33der>
of course include
<tankf33der>
like stress.l
<Regenaxer>
OK, I do
<Regenaxer>
I wanted to hear sriram's opinion, as he delved deeply into it :)
* beneroth
votes for include, too
<sriram>
hi Regenaxer...I think it would be useful
<sriram>
by the way no go function in the minimal canvas application
<beneroth>
what could be bad about including it? unless it's something very specific (as maybe dBase.l is by todays standards - you excluded it a while ago)
<sriram>
Yes...I have delved rather deeply :)
<tankf33der>
like misc/rcsim.l
<Regenaxer>
OK, thanks to all! I include them now
<beneroth>
thanks to you for providing it!
<sriram>
but that notwithstanding, I think there are some very nice and useful learning points in that code..so useful to include
<Regenaxer>
Well, a 'go' function is quasi-standard, yes
<sriram>
(beneroth ...thanks...i finally built httpgate, I did not build earlier because I had compile issues, but after downloading a few devel.i686 packages I built it...same issue thouh)
<sriram>
yes.. I did wrap the server call in go() but that did not change the outcome
<Regenaxer>
JS enabled in browser?
<Regenaxer>
btw, released with 2 new files
<beneroth>
which browser? you can probably open an web developer console in the browser by pressing F12. Maybe you see any error messages from the browser there in the JS console?
<sriram>
hmm..checking for js
<sriram>
beneroth..chrome
<Regenaxer>
Ah! I know!
<Regenaxer>
Sorry, does indeed not work with 8080
<Regenaxer>
Because of "same server policy"
<sriram>
js is allowed
<sriram>
ah so do i need httpgate then?
<Regenaxer>
Let me write a fix
<Regenaxer>
no
<Regenaxer>
A also have no httpGate on my tablet
<beneroth>
sriram, Regenaxer develops solely on his Android tablet, this days ^^
<Regenaxer>
Needs a redirect so that JS starts in the same session
<Regenaxer>
Moment
<beneroth>
that solution is nicer generally anyway
<sriram>
beneroth....that seems a great way! can do anywhere then....traveling etc
<Regenaxer>
works here now
<sriram>
i must learn two things to do that acceptably ...1. penti 2. vip
<Regenaxer>
I update the wiki
<sriram>
thanks..i will watch it
<beneroth>
yeah I already use penti for writting emails on the tablet. but not proficient enough for doing coding, not trying much recently though (no reason, just not enough time for it now)
<Regenaxer>
I fixed the wiki minimal example
<sriram>
yes, it is quite amazing thatthe test and the fix and the wiki update all done through tablet..... proof of concept that it is possible efficiently :)
<Regenaxer>
The larger example should be fine, as it works after a button press
<sriram>
thanks Regenaxer, I will pick it up and retry
<Regenaxer>
ok :)
<Regenaxer>
I did not notice, cause when I wrote this article I did on my notebook (in ancient times ;) which has httpGate
<sriram>
works perfectly now...thanks
<Regenaxer>
:)
<Regenaxer>
Sorry, must go now. Back very late
<sriram>
thanks again :) will continue with it now...
<Regenaxer>
ok :)
<Regenaxer>
bye
<sriram>
bye
<beneroth>
have a good evening Regenaxer :)
<tankf33der>
Regenaxer: sent mail, check when return.
clacke[m] has quit [Remote host closed the connection]
fwirt[m] has quit [Remote host closed the connection]
alexshendi has quit [Read error: Connection reset by peer]
fwirt[m] has joined #picolisp
clacke[m] has joined #picolisp
grp has joined #picolisp
orivej has quit [Remote host closed the connection]
orivej has joined #picolisp
beneroth has quit [Ping timeout: 264 seconds]
beneroth has joined #picolisp
<Regenaxer>
ret
<beneroth>
welcome back :)
<Regenaxer>
:)
<Regenaxer>
Was at the airport. Heavy thunderstorms all the way, and traffic jam because everybody panics
<beneroth>
floods, too?
<beneroth>
here its raining now. but not really a thunderstorm
<beneroth>
we've got here a bit sun and rain every afternoon
<Regenaxer>
The autobahn was not flooded, but a few cm water in some places
<Regenaxer>
The last weeks vere fine, above 30 C each day and a small thunderstorm in the evenings, so not too dry
<Regenaxer>
Tomorrow supposed to be hot again
<beneroth>
I prefer the cooler temperatures. running around in shorts already.
<beneroth>
I like the rain, cleans the air :)
<beneroth>
less pollen in the air then
<Regenaxer>
Very true
karswell_ has quit [Read error: No route to host]
alexshendi has joined #picolisp
clacke[m] has quit [Remote host closed the connection]
fwirt[m] has quit [Remote host closed the connection]
fwirt[m] has joined #picolisp
clacke[m] has joined #picolisp
grp has quit [Quit: box shutting down...]
fwirt[m] has quit [Remote host closed the connection]
clacke[m] has quit [Remote host closed the connection]