00:07 stanrifkin left 00:19 manu_ joined, manu_ is now known as eseyman 00:21 itaipu joined 01:28 sibl joined 01:30 librasteve_ left
grondilu any idea why `sub MAIN { start do-stuff-for-less-than-ten-seconds(); sleep 10; }` would not behave or even segfault? 02:40
when `sub MAIN { await start do-stuff-for-less-than-ten-seconds(); }` seems to work just fine?
02:42 hulk joined 02:43 kylese left
Voldenet because it's ran on thread scheduler 02:45
and when doing start you can't really expect any kind of timing
`Thread.start: &do-stuff-for-less-than-ten-seconds;` would start the actual thread in the background that would "hang" the app until aborted 02:47
03:05 arkiuat left 03:15 hulk left, kylese joined
grondilu IIUC what I really want to do is `sub MAIN { my $job = start do-this(); do-that(); await $job; }` 03:16
grondilu checks
still not quite working as expected. 03:17
03:19 arkiuat joined
grondilu What I'm trying to do is something like: `sub MAIN { my $graphics-loop = start graphics-loop(); sleep 10; await $graphics-loop; }` 03:21
`sleep` here is just meant to simulate some other job.
gist.github.com/grondilu/8628e20fb...c8aa908a19
this doesn't crash anymore, but the graphics loop does not seem to start until the sleep command has terminated. 03:22
03:27 vasko453558 left 03:33 arkiuat left 03:34 vasko453558 joined 03:49 arkiuat joined 03:56 arkiuat left 04:17 arkiuat joined 04:26 lichtkind_ joined 04:29 lichtkind left 05:10 oodani left 05:13 oodani joined 05:19 ShimmerFairy left 05:30 ShimmerFairy joined
Voldenet `my $thread = Thread.start(…); $thread.join` would use OS-level scheduler which is probably more predictable in this case, task scheduler is better for tasks that wait more than compute (networking, or interacting with other processes) also `init-white` will malloc the color every time you call it, you'll want to cache it 06:06
rarely starting a thread is a good idea, but for any realtime rendering it's actually good, because you can increase priority 06:07
or bind specific thread to the specific cpu core
06:31 Aedil joined 06:59 silug left, silug joined 07:00 sivoais_ left 07:02 sivoais joined 07:03 Pixi left, ShimmerFairy left 07:35 melezhik joined 08:06 arkiuat left
grondilu turns out I can do without multithreading: gist.github.com/grondilu/c9882fdb4...7b55781834 08:09
^this actually works, I can already play against Stockfish. Which is kind of amazing for a short program of 200 lines or so. 08:10
though it does use my Chess modules which are not really short.
08:18 arkiuat joined 08:20 abraxxa joined 08:22 arkiuat left 08:23 LainIwakura joined 08:24 Sgeo left, Sgeo joined
disbot6 <simon_sibl> I probably have a Cro problem ? github.com/4zv4l/rakubin it used to work great, but just now I realized that when I setup tls and do a request from my browser using the IP instead of the hostname (get a certificate warning), that freezes the whole Cro part (web server), the tcp server part still works somehow 08:27
08:27 arkiuat joined 08:31 abraxxa1 joined
disbot6 <simon_sibl> so I mean I cannot do any https request after that, but I can still connect to the other port using tcp and create new paste 08:32
08:33 arkiuat left 08:34 abraxxa left 09:03 arkiuat joined 09:08 arkiuat left 09:12 dakkar joined 09:18 Sgeo left 09:38 arkiuat joined 09:43 arkiuat left 09:44 melezhik left