libera/#commonlisp - IRC Chatlog
Search
21:22:58
drmeister
Does anyone remember what bordeaux threads :initial-bindings argument looks like? The updated documentation doesn't describe it.
22:23:10
drmeister
I kind of remember the Bordeaux threads documentation being more complete. It looks like it was spruced up, which I appreciate - but it's not very complete. (grumble grumble)
22:24:35
drmeister
How does one kill a thread? I remember that it was difficult (impossible?) to implement destroy-thread because signals and C++ exception handling don't talk to each other properly.
22:25:47
drmeister
Do implementations put something in to poll if a signal has been sent to a thread? I'm off my threaded programming game.
22:27:27
drmeister
And I freakin' implemented clasp's Bordeaux threads support - I should be answering the questions.
22:29:28
MichaelRaskin
But if you use what POSIX considers threads inside the same process, you cannot send a signal to a thread, it is handled by a process
22:29:56
drmeister
Ok - one less thing to deal with. What I do know is that a signal handler can set a global flag and a thread can poll that flag and then decide what to do with it.
22:31:27
drmeister
In Bordeaux threads there's destroy-thread. https://sionescu.github.io/bordeaux-threads/threads/destroy-thread/
22:37:01
yitzi
drmeister: Answered your bordeaux-threads question over in chat. I'll restate: those docs are for v2 and the v1 docs appear gone. Here is an archived copy. https://web.archive.org/web/20190921043635/http://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation
22:38:06
drmeister
MichaelRaskin: Thanks - I'm flailing a bit trying to figure out how this stuff is supposed to work and looking at my implementation to figure out what I did when I better understood how this works. I see what I did now. I implemented the underlying code of destroy-thread so that it registers an interrupt with the thread you want to destroy and when that checks its list of pending interrupts it unwinds the stack and shuts
22:39:15
drmeister
yitzi: Ah - so I'm not going crazy. I thought I remembered the documentation being more complete.
22:40:03
drmeister
And there's a v2 for bordeaux threads - that's welcome - I guess. It would be nice to keep a link to the old documentation in the meantime while the new documentation is populated with "TODO"
22:40:09
yitzi
Yeah, it's kind of irritating. I just downloaded a copy on my machine cause I am always needing them.
22:42:44
drmeister
Ok, thanks MichaelRaskin - sorry to sound a little clueless. It's been a few years since I implemented clasp's low level multithreading code and I was a little thrown off by the change in the state of the BT documentation.
23:00:09
drmeister
https://usercontent.irccloud-cdn.com/file/GONNByVH/Screen%20Recording%202021-06-12%20at%206.57.52%20PM.mov
23:55:35
pjb
drmeister: I use (list-threads) and (kill-thread) ;-) in https://github.com/informatimago/lisp/blob/master/tools/thread.lisp
1:57:55
drmeister
pjb: What does that bring to the table? It's built on bordeaux thread destroy-thread?
2:31:44
pjb
drmeister: indeed. They're repl "commands", ie, functions intended to be called interactively from the REPL. list-threads displays the list of threads. kill-thread calls list-threads, and let the user select a thread to kill it.
2:32:16
pjb
drmeister: this way, I don't have to remember how one kills a thread (when all I want to do is to kill blocked threads I forked from slime).
2:34:04
pjb
drmeister: of course, when you run slime/swank, there's also M-x slime-list-threads RET and k (slime-thread-kill) …
2:37:25
pjb
drmeister: sometimes, a what a function brings, is only its name. You didn't ask "How does one destroy a thread?", but "How does one kill a thread?", as any normal person woul do. So naturally, what is needed is a kill-thread function, not a destroy-thread function. Try (apropos "KILL") !
2:38:33
pjb
drmeister: that's also what my tools/quicklisp.lisp provides, with a bunch of (quick-…) quicklisp commands. Most are just renaming or thin layers on quicklisp stuff. Some people have really twisted naming minds…
3:36:10
drmeister
I have multiple of these workers running in parallel and I'm monitoring them and occasionally I have to stop them and make changes and then restart them.
4:51:07
hexology
i see several date/time libraries in cliki - does anyone have a personal preference?
8:19:40
beach
I added two more papers to http://metamodular.com/SICL today. I'll continue working on it.