beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
seninha has quit [Quit: Leaving]
msavoritias has joined #picolisp
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
<beneroth> [OT] someone using the Microsoft (node.js-based) IDE Visual Studio Code? a number of malicious extensions were found on its official marketplace: https://blog.checkpoint.com/securing-the-cloud/malicious-vscode-extensions-with-more-than-45k-downloads-steal-pii-and-enable-backdoors/
<tankf33der> Hi all
<tankf33der> I want to write the same code for picolisp, let me try.
<abu[m]> Hi tankf33der! Very interesting!
<abu[m]> What kind of tasks are those? Not PicoLisp 'task', right?
<tankf33der> I think about task and co
<abu[m]> One million tasks needs one million file descriptors
<abu[m]> One million 'co' are possible, but you better set a smaller stack size
<abu[m]> e.g. (stack 2)
<abu[m]> Needs 2 GiB stack space then
<abu[m]> And: Use a pil >= (23 4 18), because it is a *lot* faster in 'yield' for larger numbers of coroutines
<tankf33der> I am always on latest.
<beneroth> cool interesting topic, I'm excited for your results, good luck and lots of fun tankf33der :)
<abu[m]> Yeah, I'm excited too
<abu[m]> Still, one million file descriptors are impossible ;)
<beneroth> well the tasks also sounds more like in line for 'co than processes
<beneroth> abu[m], what about processes but using (detach) after forking?
<abu[m]> True, that's possible. Good idea.
<abu[m]> But it looks it only needs timer tasks
<abu[m]> And not even 'tasks' I think
<abu[m]> Not sure
<abu[m]> In Pil, each 'task' needs a unique key. A negative number for timers.
<abu[m]> So it needs one million negative timers, which conflicts with the requirement that each task waits 10 secs
<abu[m]> I think this benchmark really just wants to test threads. Pil uses (fork) for that. So you are right, we need (fork) and (detach).
<abu[m]> (unless (fork) (detach) (wait 10000) (bye))
<beneroth> aye
<beneroth> processes are more heavy than threads, so especially the setup phase should take longer in pil, no? and 2MB per process minimum?
<beneroth> how was that with the minimum memory allocation per pil process?
<beneroth> (maybe not actually used, but allocated just in case)
<abu[m]> I do not think that processes are much heavier than threads. Only if they modify memory, the heap is copied
<abu[m]> Stack usage and kernel structures are the same
<beneroth> ok
<beneroth> what about the minimum memory allocation by the pil interpreter? only applies to the top process, or to every forked process too?
<beneroth> was it 2MB? or 20MB? something like that I believe I remember. I don't know.
<abu[m]> The memory is shared until modified
<beneroth> so only applies to top process
<abu[m]> Yes
<abu[m]> Must go
<beneroth> kk
<abu[m]> Back soon :)
<beneroth> take care :)
<abu[m]> yess :)
<abu[m]> Still, we cannot create so many processes
<abu[m]> This works
<abu[m]> (bench (do 10000 (wait 1) (unless (fork) (detach) (wait 10000) (bye))))
<abu[m]> But not more. Too many processes.
<abu[m]> We could use 'co' and 'pause' from @lib/simul.l
<abu[m]> I have a solution with 'co', put I don't want to spoil here
<abu[m]> Also, 'co' is probably not what is expected by the above task
<beneroth> well it's concurrency, but not parallelism.
<abu[m]> true
<abu[m]> In my solution I can go only till 10 tthousand, not a million. I need I KiB per coroutine, and run out of stack space
<tankf33der> will continue tomorrow.
<abu[m]> 👍
msavoritias has quit [Remote host closed the connection]
beneroth has quit [Read error: Connection reset by peer]
beneroth_ has joined #picolisp
beneroth_ has quit [Client Quit]
beneroth has joined #picolisp
avocadoist has joined #picolisp