freenode/#sbcl - IRC Chatlog
Search
3:08:42
Theseus
looks like this does the trick, from CLHS, (pathname-type (namestring #P"/home/user/problemfile"))
10:33:41
White_Flame
the :true in read-something is somehow leaking into the derived syntax-error return type?
10:42:32
White_Flame
fresh git pull & rebuild, blow away ~/.cache/common-lisp, without .sbclrc, no slime, same style-warning
12:09:29
Harag
So I was looking into how atomic operations are done and found a Alegro article that spoke of the problems with without-interrupts when a lisp implementation supports Symmetric Multiprocessing (SMP) and then when I googled if sbcl supports smp I found that it does. So a. is it true that sbcl supports smp and b. the same issues then apply when using without-interrupts in sbcl?
12:34:47
Bike
i don't think there are very many non embedded etc computers today that _don't_ have SMP
12:36:08
no-defun-allowed
a. Yes b. If without-interrupts means the same thing to both implementations, I suppose they might have the same issues.
12:36:52
no-defun-allowed
This? https://franz.com/support/documentation/current/doc/operators/excl/without-interrupts.htm
12:38:15
no-defun-allowed
"This macro executes body, protecting against any handling of asynchronous interrupts" is common to SBCL's WITHOUT-INTERRUPTS (as I understand it).
12:38:43
no-defun-allowed
It appears to be a backwards compatibility thing, as Allegro's WITH-DELAYED-INTERRUPTS _might_ be more like W-I on SBCL: <https://franz.com/support/documentation/current/doc/operators/excl/with-delayed-interrupts.htm>
12:44:37
Harag
So the same issues apply if read it right ... "it provides no cross-process protection of shared objects"
12:45:39
no-defun-allowed
Indeed. You would likely use a lock instead to allow only one thread to modify some objects at a time.
12:47:07
no-defun-allowed
But if that seems like it's just more complexity, then also consider that a lock only stops threads waiting to acquire the lock, and not all threads (like non-SMP Franz would, I figure).
12:48:42
Harag
Ok that makes sense, I was thinking of using something like mvar from haskell to force synchronous access
12:54:03
Harag
I found an implementation of mvar for lisp that uses locks ... CAS in sbcl uses without-interrupts as far as I can see
13:06:04
no-defun-allowed
An mvar is a queue of length 1, right? That would not be so hard to implement using CAS, but I would think deciding what to stick in an mvar or what to lock takes similar effort.
13:07:17
no-defun-allowed
But my general advice is to initially be lazy with locking, preferring coarse locking and going finer (or lockless when you have the knowledge) when you find threads are blocking too much.