Logs: freenode/#haskell
| 2021-03-17 19:40:09 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 19:40:45 | <monochrom> | For example you don't go "bracket (acquire lock #1; acquire lock #2) ...". Split it into two calls to bracket, one per lock. |
| 2021-03-17 19:42:17 | <__minoru__shirae> | it says "An exception raised by a second blocking operation would not result in after being executed." - but if the exception is thrown during "before", then "after" shouldn't even run, right? |
| 2021-03-17 19:42:20 | → | kam1 joins (~kam1@83.123.237.152) |
| 2021-03-17 19:42:36 | <__minoru__shirae> | because the guarantee is that "after" runs after the "before" returned |
| 2021-03-17 19:43:13 | <__minoru__shirae> | maybe the text should say something about a "thing" instead of "before" |
| 2021-03-17 19:44:22 | thonkpod_ | is now known as thonkpod |
| 2021-03-17 19:44:22 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 19:44:29 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 19:44:48 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2021-03-17 19:44:50 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-17 19:45:35 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-17 19:46:09 | → | RandomArcher joins (~RandomArc@90.153.166.31) |
| 2021-03-17 19:46:34 | × | RandomArcher quits (~RandomArc@90.153.166.31) (Remote host closed the connection) |
| 2021-03-17 19:46:47 | → | Franciman joins (~francesco@host-79-53-62-46.retail.telecomitalia.it) |
| 2021-03-17 19:46:58 | <monochrom> | Where is that text? I can't find it in Control.Exception's doc. |
| 2021-03-17 19:47:26 | <__minoru__shirae> | it's from the "Parallel and Concurrent Programming in Haskell" book by Simon Marlow |
| 2021-03-17 19:47:50 | → | kam1 joins (~kam1@83.123.237.152) |
| 2021-03-17 19:48:02 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 19:48:02 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 19:48:04 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 19:49:00 | → | kam1 joins (~kam1@83.123.237.152) |
| 2021-03-17 19:49:27 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 19:50:35 | <__minoru__shirae> | I tried adding a second blocking operation both to "before" and a "thing" - it works as one would expect |
| 2021-03-17 19:51:11 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 19:51:21 | → | kam1 joins (~kam1@83.123.237.152) |
| 2021-03-17 19:51:25 | <__minoru__shirae> | "after" runs only when the exception is thrown in a "thing", not in "before" |
| 2021-03-17 19:51:25 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-17 19:51:25 | <geekosaur> | te problem comes in the finalizer, how do you know that both things have been allocated? |
| 2021-03-17 19:51:39 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:f837:3533:97b:1f44) |
| 2021-03-17 19:51:42 | × | esp32_prog quits (esp32_prog@gateway/vpn/mullvad/esp32prog/x-46565127) (Ping timeout: 260 seconds) |
| 2021-03-17 19:51:58 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 19:52:01 | <monochrom> | OK, the scenerio is if "before" doesn't return normally, i.e., aborted because of an exception. |
| 2021-03-17 19:52:10 | <geekosaur> | so if the finalizer doesn't run if an exception is thrown in before, but after you have allocated some resouce, you have just leaked that resource |
| 2021-03-17 19:52:10 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 19:52:14 | <monochrom> | Since "before" doesn't return normally, "after" is not run. |
| 2021-03-17 19:52:24 | malumore_ | is now known as malumore |
| 2021-03-17 19:52:31 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-17 19:52:49 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 19:52:50 | <maralorn> | __minoru__shirae: I think what you are saying and citing makes sense together. When (acquire lock #2) fails the finalizer will not be run. You are correct about that. And that's why you should write it like monochrom wrote. |
| 2021-03-17 19:53:03 | <monochrom> | But if "before" consists of acquiring two locks, perhaps one lock is acquired before the abortion. Now no one is freeing that lock. |
| 2021-03-17 19:53:11 | <maralorn> | you shouldn‘t |
| 2021-03-17 19:54:17 | <__minoru__shirae> | oh, I see: so the exception in the second blocking operation "hides" the successfull allocation of the first operation in "before" |
| 2021-03-17 19:55:27 | <__minoru__shirae> | but I see no problem in delaying a thread as many times as you want before allocation a resource in "before" |
| 2021-03-17 19:55:36 | → | benkolera joins (uid285671@gateway/web/irccloud.com/x-phaufigullyuswqk) |
| 2021-03-17 19:55:39 | <__minoru__shirae> | *allocating |
| 2021-03-17 19:56:03 | → | myShoggoth joins (~myShoggot@75.164.81.55) |
| 2021-03-17 19:56:14 | <__minoru__shirae> | I mean literally calling threadDelay |
| 2021-03-17 19:56:44 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 19:56:58 | <monochrom> | OK, so you're doing "bracket (sleep 5 seconds; open a file but this also takes 5 seconds becuase NFS or something) ..." |
| 2021-03-17 19:57:28 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 19:57:33 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 19:57:38 | <monochrom> | Hrm not a good example. Nevermind. |
| 2021-03-17 19:58:08 | <__minoru__shirae> | yes, the rule is not about a count of blocking operations per se, but about exceptions in later blocking operations hiding allocations from previous operations |
| 2021-03-17 19:58:13 | <monochrom> | But seriously, I consider "bracket (sleep 5 seconds; open file)" trolling the computer. Why would you write code like that. |
| 2021-03-17 19:58:44 | <geekosaur> | you do lose the result of the presumed-to-have-failed acquire operation in the result of the interrupted threadDelay |
| 2021-03-17 19:58:53 | <geekosaur> | which you may well care about |
| 2021-03-17 20:02:51 | <__minoru__shirae> | thanks, I think I get it now. The text is slightly misleading or confusing, maybe the author didn't want to spend too much time discussing subtleties of "bracket" and wanted to move on. The section is pretty short. |
| 2021-03-17 20:03:57 | <geekosaur> | "blocking" also has a specific meaning with respect to ghc, which is rather more than just what threadDelay does and indeed has more to do with resource acquisition/possible leakage |
| 2021-03-17 20:05:06 | × | petersen quits (~petersen@redhat/juhp) (Ping timeout: 244 seconds) |
| 2021-03-17 20:05:23 | hackage | google-oauth2-jwt 0.3.3 - Get a signed JWT for Google Service Accounts https://hackage.haskell.org/package/google-oauth2-jwt-0.3.3 (MichelBoucey) |
| 2021-03-17 20:05:48 | × | mikoto-chan quits (~anass@gateway/tor-sasl/mikoto-chan) (Ping timeout: 268 seconds) |
| 2021-03-17 20:06:42 | × | hiroaki quits (~hiroaki@2a02:8108:8c40:2bb8:e36e:9885:3dcc:fcb4) (Ping timeout: 260 seconds) |
| 2021-03-17 20:08:30 | → | petersen joins (~petersen@redhat/juhp) |
| 2021-03-17 20:08:34 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 20:09:02 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 20:09:39 | → | mikoto-chan joins (~anass@gateway/tor-sasl/mikoto-chan) |
| 2021-03-17 20:09:50 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 20:11:36 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 20:11:57 | × | conal quits (~conal@64.71.133.70) (Ping timeout: 264 seconds) |
| 2021-03-17 20:12:06 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-17 20:12:36 | × | mikoto-chan quits (~anass@gateway/tor-sasl/mikoto-chan) (Remote host closed the connection) |
| 2021-03-17 20:12:57 | → | mikoto-chan joins (~anass@gateway/tor-sasl/mikoto-chan) |
| 2021-03-17 20:13:01 | → | kam1 joins (~kam1@83.123.237.152) |
| 2021-03-17 20:13:04 | × | PtxDK quits (~quassel@2a01:7c8:aac3:591:5054:ff:fe3d:cac6) (Quit: No Ping reply in 180 seconds.) |
| 2021-03-17 20:13:27 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 20:13:34 | × | mikoto-chan quits (~anass@gateway/tor-sasl/mikoto-chan) (Remote host closed the connection) |
| 2021-03-17 20:13:44 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 20:14:02 | → | Tops2 joins (~Tobias@dyndsl-095-033-095-010.ewe-ip-backbone.de) |
| 2021-03-17 20:14:09 | → | PtxDK joins (~quassel@2a01:7c8:aac3:591:5054:ff:fe3d:cac6) |
| 2021-03-17 20:15:14 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 20:15:57 | → | conal joins (~conal@66.115.157.150) |
| 2021-03-17 20:16:22 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 20:18:20 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 20:18:42 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-17 20:19:34 | → | hiroaki joins (~hiroaki@2a02:8108:8c40:2bb8:7ae2:2c33:b1ea:eeb7) |
| 2021-03-17 20:21:12 | → | olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber) |
| 2021-03-17 20:23:17 | × | Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 265 seconds) |
| 2021-03-17 20:25:15 | → | ADG1089__ joins (~aditya@106.214.253.186) |
| 2021-03-17 20:25:15 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 20:25:31 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-03-17 20:25:47 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-17 20:27:56 | → | kam1 joins (~kam1@83.123.237.152) |
| 2021-03-17 20:28:02 | × | ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection) |
| 2021-03-17 20:28:21 | × | kam1 quits (~kam1@83.123.237.152) (Read error: Connection reset by peer) |
| 2021-03-17 20:30:15 | × | hexfive quits (~hexfive@50.35.83.177) (Quit: i must go. my people need me.) |
| 2021-03-17 20:31:52 | → | Wuzzy joins (~Wuzzy@p57a2ecf2.dip0.t-ipconnect.de) |
| 2021-03-17 20:32:07 | × | jb55 quits (~jb55@gateway/tor-sasl/jb55) (Remote host closed the connection) |
| 2021-03-17 20:32:07 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-17 20:32:16 | → | jb55 joins (~jb55@gateway/tor-sasl/jb55) |
All times are in UTC.