2024/05/06

Newest at the top

2024-05-06 18:58:05 +0200justsomeguy(~justsomeg@user/justsomeguy)
2024-05-06 18:57:29 +0200tri(~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 268 seconds)
2024-05-06 18:52:35 +0200tri(~tri@ool-18bbef1a.static.optonline.net)
2024-05-06 18:46:12 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 255 seconds)
2024-05-06 18:46:08 +0200chele(~chele@user/chele) (Remote host closed the connection)
2024-05-06 18:44:31 +0200econo_(uid147250@id-147250.tinside.irccloud.com)
2024-05-06 18:36:29 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-05-06 18:32:56 +0200 <gastus> https://hackage.haskell.org/package/base-4.19.1.0/docs/Control-Concurrent.html#v:threadDelay @ erty Read the docs: There it says will not be scheduled earlier but will wait at least. So threadDelay will allow other theads to continue. So RTFM :-)
2024-05-06 18:32:49 +0200 <EvanR> more like no write
2024-05-06 18:32:20 +0200 <EvanR> what xD
2024-05-06 18:32:09 +0200 <EvanR> copy on write??
2024-05-06 18:31:18 +0200 <gastus> If you want to sleep until you release try reading from socket file or so and echo a byte into it to release the stalling.
2024-05-06 18:30:51 +0200kimiamania(~76637481@user/kimiamania)
2024-05-06 18:30:29 +0200kimiamania(~76637481@user/kimiamania) (Quit: Ping timeout (120 seconds))
2024-05-06 18:30:16 +0200 <gastus> If its testing only any of the solutions probaly get the job done. If you want to do A/B testing on web server which should not stall .. then you want ot use a version provide dby the GHC runtime which allows other threads to conitnue. So evenutally spawn 100 threads and see what happens with what sleep solution ? Then you know.
2024-05-06 18:29:24 +0200 <gastus> You can run a GHC complied program with different multithreading options. So looks like you're eventually touching that stuff.
2024-05-06 18:29:22 +0200 <erty> gastus: Thanks a lot. I will look into that.
2024-05-06 18:28:28 +0200 <gastus> https://hoogle.haskell.org/?q=sleep&hoogle=sleep And Hoogle says there are sleep implementations, too. Now you might perefer eg the GHC verison so that GHC can use CPU for other threads.
2024-05-06 18:27:48 +0200 <gastus> Most languages call it sleep, but https://stackoverflow.com/questions/47816174/how-to-sleep-or-delay-the-thread-in-haskell indicates threadDelay works
2024-05-06 18:27:33 +0200 <davean> It won't compile, for the obvious reason
2024-05-06 18:27:22 +0200 <gastus> Why not just try it ?
2024-05-06 18:27:18 +0200 <davean> gastus: it isn't about IO implimentations, its about how libraries interface with them
2024-05-06 18:26:37 +0200 <erty> davean: I just want to delay the execution by some time period
2024-05-06 18:26:33 +0200 <gastus> davean: I am not up to date about how many IO implementations exist today. In the past I heard about a rewrite with different locking features.
2024-05-06 18:26:15 +0200euleritian(~euleritia@77.22.252.56)
2024-05-06 18:25:54 +0200 <davean> But nothing he's talkign about is that
2024-05-06 18:25:49 +0200 <gastus> You eventually cannot easily translate JS into Haskell. Haskess has unique copy on write properties making real multithreading possible.
2024-05-06 18:25:48 +0200 <davean> gastus: I mean async/await structures also directly make sense for IO
2024-05-06 18:25:43 +0200euleritian(~euleritia@77.22.252.56) (Read error: Connection reset by peer)
2024-05-06 18:25:21 +0200 <gastus> erty: Haskell has its own multi thread engine builtin. Its cheap in Haskell. So its ok to spawn 20K threads each doing its own thing and waitingc for it. Why not lookup fork and STM and IO and the stuff ? That's the haskell way to sync and wait for threads. Mvar was the the way to synchronize threads.
2024-05-06 18:25:20 +0200 <erty> https://stackoverflow.com/questions/47816174/how-to-sleep-or-delay-the-thread-in-haskell
2024-05-06 18:24:54 +0200 <erty> threadDelay is something I got after searching online
2024-05-06 18:24:23 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-05-06 18:24:11 +0200 <davean> The sense in which async/await delays a function is not at all the sense threadDelay delays it
2024-05-06 18:24:01 +0200 <erty> I can set a timer and wait for the promise to resolve
2024-05-06 18:23:21 +0200 <davean> this is nothing like async/await
2024-05-06 18:23:12 +0200 <erty> I am just curious, like async/await in javascript
2024-05-06 18:22:43 +0200 <davean> yes technically, but no, that would be bad in several ways
2024-05-06 18:22:34 +0200 <nullie> why do you want to do that?
2024-05-06 18:21:52 +0200 <erty> Now Haskell provide us with a function "threadDelay :: Int -> IO ()" in the module "Control.Concurrent", can I use that, to delay the above function.
2024-05-06 18:21:44 +0200 <erty> I have a ques, Is it possible to add delay to a function (eg. add :: Int -> Int)? https://paste.tomsmeding.com/qx8saWEW
2024-05-06 18:20:55 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-05-06 18:16:03 +0200Guest58(~Guest58@2402:3a80:a19:7f89:8f72:7bde:6107:e78c) (Quit: Client closed)
2024-05-06 18:15:06 +0200euleritian(~euleritia@77.22.252.56)
2024-05-06 18:14:43 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 255 seconds)
2024-05-06 18:14:05 +0200Angelz(Angelz@Angelz.oddprotocol.org)
2024-05-06 18:13:46 +0200euleritian(~euleritia@dynamic-176-005-138-072.176.5.pool.telefonica.de) (Read error: Connection reset by peer)
2024-05-06 18:02:19 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-05-06 17:58:12 +0200Angelz(Angelz@user/angelz) (Ping timeout: 260 seconds)
2024-05-06 17:54:14 +0200rosco(~rosco@yp-146-6.tm.net.my) (Quit: Lost terminal)