2015-01-21T00:10:03Z stassats joined #sbcl 2015-01-21T00:10:03Z stassats quit (Client Quit) 2015-01-21T00:19:03Z milosn quit (Ping timeout: 272 seconds) 2015-01-21T00:25:39Z milosn joined #sbcl 2015-01-21T00:28:16Z nikki93 joined #sbcl 2015-01-21T00:37:09Z akkad: bordeaux threads says no thread support on openbsd. 2015-01-21T00:40:27Z akkad: so freebsd would be the reference I should look at for netbsd 2015-01-21T01:13:57Z attila_lendvai quit (Quit: Leaving.) 2015-01-21T01:40:20Z Adlai quit (Quit: WeeChat 1.0.1) 2015-01-21T01:44:24Z scymtym quit (Ping timeout: 245 seconds) 2015-01-21T01:45:29Z slyrus joined #sbcl 2015-01-21T02:02:41Z slyrus quit (Ping timeout: 252 seconds) 2015-01-21T02:04:40Z slyrus joined #sbcl 2015-01-21T02:05:38Z hlavaty quit (Ping timeout: 265 seconds) 2015-01-21T02:15:30Z echo-area joined #sbcl 2015-01-21T02:22:09Z loke: Are SBCL assignments (using SETQ) atomic? In other words, if I'm using the fset library (non-mutable collections), do I still have to protect the assignments to globals using a mutex? (i.e. is the following safe? (setq *my-map* (fset:manipulate-it *my-map*)) 2015-01-21T02:25:07Z nyef: Atomic in what context? 2015-01-21T02:25:38Z nyef: Are you looking for save-vs-SIGINT or save-vs-other-thread? 2015-01-21T02:25:53Z loke: nyef: In the sense that any other thread reading the value is guaranteed to get either the new value, or the old value, but not a partial value 2015-01-21T02:26:45Z nyef: Ah, yeah, it'll typically be one or the other, but you'll be staring down some pretty weird cache effects if it's a pointer value and you're not using a memory barrier. 2015-01-21T02:28:42Z loke: Thanks. Going to a meeting now. 2015-01-21T02:29:27Z loke: But... Is there any way of doing atomic writes to a global without cache consistency problems? Can I force a memory barrier or something? 2015-01-21T02:29:43Z nyef: Yes. CAS serves as a barrier, and there's the BARRIER macro. 2015-01-21T02:35:44Z LiamH joined #sbcl 2015-01-21T02:38:47Z pkhuong: define consistency problems 2015-01-21T02:38:59Z pkhuong: do you want an atomic write, or do you need to ensure visibility? 2015-01-21T02:39:14Z pkhuong: yeah, normal write to a global will be atomic 2015-01-21T02:39:25Z pkhuong: you want a barrier on non-TSO platforms though 2015-01-21T03:09:52Z cmack quit (Ping timeout: 240 seconds) 2015-01-21T03:26:09Z DeadTrickster quit (Read error: No route to host) 2015-01-21T03:38:22Z christop1 quit (Ping timeout: 240 seconds) 2015-01-21T03:40:11Z DeadTrickster joined #sbcl 2015-01-21T03:44:39Z scymtym joined #sbcl 2015-01-21T03:45:58Z loke: pkhuong: In this particular case, it's a cache, so if the change doesn't hjave full visibility, it doesn't really matter 2015-01-21T03:46:18Z loke: pkhuong: that said, I'd be very interested to know how to ensure visibility too (I might need it next time) 2015-01-21T03:51:46Z christop1 joined #sbcl 2015-01-21T04:02:53Z DeadTrickster quit (Ping timeout: 245 seconds) 2015-01-21T04:13:34Z LiamH quit (Quit: Leaving.) 2015-01-21T04:28:57Z tmh_ joined #sbcl 2015-01-21T04:31:29Z DeadTrickster joined #sbcl 2015-01-21T04:33:16Z tmh_ quit (Changing host) 2015-01-21T04:33:17Z tmh_ joined #sbcl 2015-01-21T04:39:22Z slyrus quit (Ping timeout: 240 seconds) 2015-01-21T04:41:05Z pkhuong: visibility is never about timeliness, but about forcing certain ordering 2015-01-21T04:42:32Z pkhuong: barrier on non-tso, nothing special when publishing on tso (x86oids and sparc) 2015-01-21T04:46:10Z loke: Fair enough 2015-01-21T04:46:39Z loke: but if there is no barrier on a platform such as SPARC, couldn't you potentially be reading old cached values for a very long time? 2015-01-21T04:48:13Z nyef: In a word, yes. 2015-01-21T04:49:08Z loke: A related question: In a lock-free scenario, how do you handle the following common (at least for me) scenario: 2015-01-21T04:49:42Z loke: Let's say you have a hashtable keyed on some string, the value of each key contains the state that pertains to that key 2015-01-21T04:49:51Z loke: One often ends up with a function such as: 2015-01-21T04:50:27Z loke: (defun find-state (key) (or (gethash key...) (setf (gethash key... (make-new-state))) 2015-01-21T04:51:02Z loke: (of course, wrapped by a lock) 2015-01-21T05:12:32Z edgar-rft quit (Quit: memory access destroyed by mental death) 2015-01-21T05:24:37Z nyef quit (Quit: G'night all) 2015-01-21T05:30:05Z redline6561 quit (Ping timeout: 265 seconds) 2015-01-21T05:30:39Z redline6561 joined #sbcl 2015-01-21T05:39:29Z psilord quit (Quit: Leaving.) 2015-01-21T06:02:19Z scymtym quit (Ping timeout: 272 seconds) 2015-01-21T06:06:10Z pranavrc joined #sbcl 2015-01-21T06:06:10Z pranavrc quit (Changing host) 2015-01-21T06:06:10Z pranavrc joined #sbcl 2015-01-21T06:09:33Z oleo__ quit (Quit: Verlassend) 2015-01-21T06:14:46Z nikki93 quit (Remote host closed the connection) 2015-01-21T06:52:21Z sdemarre joined #sbcl 2015-01-21T07:00:14Z Quadrescence quit (Quit: This computer has gone to sleep) 2015-01-21T07:10:25Z Shinmera joined #sbcl 2015-01-21T07:20:17Z psy_ quit (Ping timeout: 246 seconds) 2015-01-21T07:26:09Z psy_ joined #sbcl 2015-01-21T07:37:19Z sdemarre quit (Ping timeout: 245 seconds) 2015-01-21T07:58:47Z angavrilov joined #sbcl 2015-01-21T08:11:57Z pranavrc quit (Remote host closed the connection) 2015-01-21T08:41:57Z chu quit (Ping timeout: 245 seconds) 2015-01-21T08:44:07Z chu joined #sbcl 2015-01-21T09:00:19Z Cymew joined #sbcl 2015-01-21T09:13:47Z pranavrc joined #sbcl 2015-01-21T09:13:48Z pranavrc quit (Changing host) 2015-01-21T09:13:48Z pranavrc joined #sbcl 2015-01-21T09:36:08Z hlavaty joined #sbcl 2015-01-21T09:40:02Z pacon joined #sbcl 2015-01-21T09:58:29Z chu quit (Ping timeout: 246 seconds) 2015-01-21T10:00:22Z chu joined #sbcl 2015-01-21T10:30:38Z stassats joined #sbcl 2015-01-21T10:55:53Z dekhoda joined #sbcl 2015-01-21T11:36:07Z nikki93 joined #sbcl 2015-01-21T11:37:04Z nikki93 quit (Remote host closed the connection) 2015-01-21T11:49:29Z sdemarre joined #sbcl 2015-01-21T11:50:02Z gingerale quit (Read error: Connection reset by peer) 2015-01-21T11:52:50Z gingerale joined #sbcl 2015-01-21T12:07:27Z pacon quit (Read error: Connection reset by peer) 2015-01-21T12:08:27Z eudoxia joined #sbcl 2015-01-21T12:30:27Z pkhuong: loke: re lack of barrier. There's no guarantee that the barrier will fully execute for a very long time either. 2015-01-21T12:32:28Z edgar-rft joined #sbcl 2015-01-21T12:33:40Z pkhuong: also, re visibility, the issue isn't that the write to the global isn't visible, but that contents of the new fset won't be. 2015-01-21T12:34:13Z pkhuong: let's assume the hash table is thread-safe for writes (e.g., synchronised or lock-free). Then, for a cache, it's probably easiest to just overwrite the old entry if there's any. Otherwise, you'll want a write-if-empty or compare-and-swap primitive. 2015-01-21T12:35:48Z pkhuong: for fset, you can easily do a compare-and-swap on the root of the tree (the fset object). That'll tend to cause contention (on the CAS location) and spurious failure for disjoint writes, but that's pretty much unavoidable with purely functional data structures 2015-01-21T12:39:22Z soggybread joined #sbcl 2015-01-21T12:47:39Z irsol quit (Ping timeout: 252 seconds) 2015-01-21T12:54:52Z dekhoda quit (Ping timeout: 245 seconds) 2015-01-21T12:56:47Z davazp joined #sbcl 2015-01-21T13:03:49Z irsol joined #sbcl 2015-01-21T13:07:22Z attila_lendvai joined #sbcl 2015-01-21T13:09:39Z irsol quit (Ping timeout: 264 seconds) 2015-01-21T13:13:44Z Hache_ joined #sbcl 2015-01-21T13:16:42Z psy_ quit (Read error: No route to host) 2015-01-21T13:18:31Z psy_ joined #sbcl 2015-01-21T13:19:06Z psy_ quit (Max SendQ exceeded) 2015-01-21T13:19:34Z psy_ joined #sbcl 2015-01-21T13:22:25Z pranavrc quit 2015-01-21T13:23:59Z irsol joined #sbcl 2015-01-21T13:25:08Z dekhoda joined #sbcl 2015-01-21T13:27:18Z dekhoda quit (Client Quit) 2015-01-21T13:27:37Z dekhoda joined #sbcl 2015-01-21T13:27:46Z dekhoda quit (Remote host closed the connection) 2015-01-21T13:27:59Z dekhoda joined #sbcl 2015-01-21T13:30:47Z irsol quit (Ping timeout: 244 seconds) 2015-01-21T13:33:36Z irsol joined #sbcl 2015-01-21T13:40:22Z psy_ quit (Ping timeout: 240 seconds) 2015-01-21T13:42:30Z irsol quit (Ping timeout: 264 seconds) 2015-01-21T13:46:46Z irsol joined #sbcl 2015-01-21T13:46:53Z karswell joined #sbcl 2015-01-21T13:48:01Z psy_ joined #sbcl 2015-01-21T14:02:51Z stassats: in (defun foo () (declare (optimize speed)) (bar 1 2 3 4 5 6 7 5 8) 1) stack space is allocated twice 2015-01-21T14:03:22Z stassats: once in the XEP, and once for the function call 2015-01-21T14:03:51Z stassats: (sb-allocated-size 'stack) seems to be growing with each additional argument, even though it's not really stored there 2015-01-21T14:17:43Z pkhuong: there's only one stack frame format per component 2015-01-21T14:17:49Z nyef joined #sbcl 2015-01-21T14:19:08Z stassats: it allocates space for frame-pointer-relative access, which is not used 2015-01-21T14:19:39Z stassats: because for the call it just extends RSP again and uses that for loading arguments 2015-01-21T14:20:37Z davazp quit (Ping timeout: 256 seconds) 2015-01-21T14:40:45Z oleo joined #sbcl 2015-01-21T14:41:24Z stassats: the way ir2-convert-full-call-args goes, it makes wired tns for the standard stack locations 2015-01-21T14:48:38Z stassats: don't know how to solve that, have another stack storage class? 2015-01-21T14:50:42Z pkhuong: does it really matter? 2015-01-21T14:51:07Z stassats: it uses more stack than needed for no reason 2015-01-21T14:52:17Z stassats: so, each time you call a function with more than 3 arguments, you waste stack space 2015-01-21T14:54:30Z stassats: we already have ignore-me-sc-number 2015-01-21T14:57:22Z pkhuong: for stack space? can we try to zero out the frame on entry instead? 2015-01-21T14:57:53Z stassats: zero out the frame? what do you mean? 2015-01-21T14:58:46Z pkhuong: I don't really care about stack space itself 2015-01-21T14:59:04Z pkhuong: I might care about reducing conservative roots 2015-01-21T15:00:02Z stassats: i care about both, just because it can be reduced without any adverse effects 2015-01-21T15:00:30Z attila_lendvai quit (Quit: Leaving.) 2015-01-21T15:07:17Z Adlai joined #sbcl 2015-01-21T15:10:13Z Adlai quit (Remote host closed the connection) 2015-01-21T15:11:02Z Adlai joined #sbcl 2015-01-21T15:26:53Z stassats: solved this in some convoluted way 2015-01-21T15:27:04Z stassats: not good enough to be comitted 2015-01-21T15:31:52Z irsol quit (Ping timeout: 240 seconds) 2015-01-21T15:40:52Z stassats: same deal with (nth-value 10 (bar 1 2 3)), allocates 10 stack slots 2015-01-21T15:41:45Z stassats: nth-value is pretty bad in general 2015-01-21T15:47:32Z stassats: found a less convolued way for both, just not pushing it into ir2-component-wired-tns 2015-01-21T15:54:56Z irsol joined #sbcl 2015-01-21T16:00:06Z irsol quit (Ping timeout: 244 seconds) 2015-01-21T16:04:14Z irsol joined #sbcl 2015-01-21T16:10:19Z Adlai quit (Remote host closed the connection) 2015-01-21T16:10:52Z Adlai joined #sbcl 2015-01-21T16:21:56Z Hache__ joined #sbcl 2015-01-21T16:22:51Z Hache_ quit (Ping timeout: 264 seconds) 2015-01-21T16:31:20Z eudoxia quit (Quit: Leaving) 2015-01-21T16:55:10Z Hache_ joined #sbcl 2015-01-21T16:55:39Z Hache__ quit (Ping timeout: 245 seconds) 2015-01-21T17:01:19Z Hache__ joined #sbcl 2015-01-21T17:01:51Z Hache_ quit (Ping timeout: 264 seconds) 2015-01-21T17:05:00Z Hache_ joined #sbcl 2015-01-21T17:06:41Z Hache__ quit (Ping timeout: 272 seconds) 2015-01-21T17:08:42Z Hache__ joined #sbcl 2015-01-21T17:09:51Z Hache_ quit (Ping timeout: 272 seconds) 2015-01-21T17:10:45Z Adlai quit (Remote host closed the connection) 2015-01-21T17:11:10Z Adlai joined #sbcl 2015-01-21T17:36:31Z scymtym joined #sbcl 2015-01-21T17:59:22Z Hache_ joined #sbcl 2015-01-21T18:00:31Z Hache__ quit (Ping timeout: 272 seconds) 2015-01-21T18:03:53Z Hache_ quit (Ping timeout: 256 seconds) 2015-01-21T18:07:08Z psy_ quit (Read error: No route to host) 2015-01-21T18:08:48Z Bicyclidine joined #sbcl 2015-01-21T18:21:12Z Quadrescence joined #sbcl 2015-01-21T18:23:47Z psy_ joined #sbcl 2015-01-21T18:41:26Z eudoxia joined #sbcl 2015-01-21T18:44:03Z gabriel_laddel joined #sbcl 2015-01-21T19:03:59Z Bicyclidine quit (Ping timeout: 245 seconds) 2015-01-21T19:06:14Z stassats quit (Ping timeout: 246 seconds) 2015-01-21T19:11:26Z Adlai quit (Remote host closed the connection) 2015-01-21T19:11:54Z Adlai joined #sbcl 2015-01-21T19:17:52Z Bicyclidine joined #sbcl 2015-01-21T19:35:49Z stassats joined #sbcl 2015-01-21T19:36:15Z stassats quit (Client Quit) 2015-01-21T19:39:58Z gabriel_laddel quit (Ping timeout: 245 seconds) 2015-01-21T19:51:18Z gabriel_laddel joined #sbcl 2015-01-21T20:14:23Z nikki93 joined #sbcl 2015-01-21T20:14:31Z nikki93 quit (Remote host closed the connection) 2015-01-21T20:28:05Z fitzsim joined #sbcl 2015-01-21T21:02:22Z sdemarre quit (Ping timeout: 245 seconds) 2015-01-21T21:13:12Z angavrilov quit (Remote host closed the connection) 2015-01-21T21:18:35Z minion quit (Remote host closed the connection) 2015-01-21T21:18:46Z minion joined #sbcl 2015-01-21T21:25:12Z dekhoda quit (Quit: dekhoda) 2015-01-21T22:03:49Z Shinmera quit (Quit: しつれいしなければならないんです。) 2015-01-21T22:12:35Z Adlai quit (Remote host closed the connection) 2015-01-21T22:13:06Z Adlai joined #sbcl 2015-01-21T22:28:42Z slyrus joined #sbcl 2015-01-21T22:51:45Z eudoxia quit (Quit: Leaving) 2015-01-21T22:57:57Z Bicyclidine quit (Ping timeout: 265 seconds) 2015-01-21T23:09:39Z Bicyclidine joined #sbcl 2015-01-21T23:12:33Z Adlai quit (Remote host closed the connection) 2015-01-21T23:13:54Z Adlai joined #sbcl 2015-01-21T23:20:05Z alchemis7 quit (Ping timeout: 256 seconds) 2015-01-21T23:29:31Z Adlai quit (Quit: WeeChat 1.0.1) 2015-01-21T23:33:28Z slyrus_ joined #sbcl 2015-01-21T23:34:17Z slyrus quit (Ping timeout: 272 seconds) 2015-01-21T23:34:25Z slyrus_ is now known as slyrus 2015-01-21T23:56:04Z oleo quit (Read error: Connection reset by peer) 2015-01-21T23:57:42Z oleo joined #sbcl 2015-01-21T23:57:53Z Bicyclidine quit (Ping timeout: 265 seconds) 2015-01-21T23:58:12Z attila_lendvai joined #sbcl 2015-01-21T23:58:12Z attila_lendvai quit (Changing host) 2015-01-21T23:58:12Z attila_lendvai joined #sbcl 2015-01-21T23:59:43Z Bicyclidine joined #sbcl