freenode/#clasp - IRC Chatlog
Search
4:29:17
drmeister
Do you know about the Memory Pool System library? It's got a lot of the features that you have been talking about. Non moving pools, mark and sweep pools, compacting pools etc.
4:35:15
Bike
like you can specify "allocation pattern" hints, and schedule collections in a soft real time way
4:38:39
drmeister
Bike: Did you see these functions? https://github.com/drmeister/clasp/blob/dev/src/gctools/gcFunctions.cc#L471
4:41:07
Bike
i think room is slightly dangerous. the documentation says you can't map objects (with mps_amc_apply) without parking the arena first.
4:45:39
drmeister
Yeah - I went looking for the call that parked the arena in cl__room and didn't see it - why did I leave that out?
4:51:52
beach
drmeister: As a general principle, I am not interested in trying to keep up with external software. I see every day how Clasp maintainers try to debug problems with unknown code, try to contact people in charge, try to figure what will break after the next release of such code, etc.
4:51:58
beach
I am even less interested if this software happens to be written in C or some other low-level language. When it comes to memory management, I would like to try out my own ideas first, because they are made possible by the uniform representation of SICL objects.
4:51:59
beach
It may not be worthwhile trying to keep up with a complex system such as MPS when I only need a tiny fraction of what it can do. I am willing to change my mind, of course, but only after I try my own ideas.
4:55:31
drmeister
I know - I'm just making small talk - and I'm happy for the help that stassats gave me.
12:24:53
drmeister
I haven't done coordination between threads before - I need to do a bit of research.
12:35:46
Shinmera
drmeister: To synchronise two threads you use a barrier, or failing such a construct a monitor/condition variable, or failing such a construct, a spinlock with an exponential backoff.
12:38:25
stassats
anyway, spinlock is an optimization which may result in poor performance and energy usage if done incorrectly
13:25:28
drmeister
I don't have formal training in parallel programming. I'm picking this up as I go along.
13:29:18
stassats
it works, until it doesn't, when your checker becomes unscheduled and the child thread progresses to Exit, it'll spin forever
13:31:17
drmeister
Right - so my while (this->_Phase != Active) {}; was not completely wrong headed. I'm reacting and not thinking - its too early.
13:32:11
drmeister
I'm going to take a shower and then take another look at it and look at condition variables. I implemented them but haven't used them yet.
13:33:52
drmeister
pthreads have them - I have been careful not to mix C++ threading constructs and pthreads. I can't be sure what the underlying implementation of the C++ threading constructs are.
13:34:02
drmeister
I have this: https://github.com/drmeister/clasp/blob/dev/include/clasp/core/mpPackage.fwd.h#L270
13:34:14
drmeister
And exposed it to Common Lisp here: https://github.com/drmeister/clasp/blob/dev/include/clasp/core/mpPackage.h#L285
14:29:59
drmeister
The pthreads manual talks about checking a global variable - I'm not sure what they are going on about.
14:30:56
drmeister
I also couldn't see the reason the check the Process_O::_Phase variable - although I set it to the appropriate values through the process.
14:32:00
drmeister
From what I understand - all I need is a Process_O::_ExitBarrier mutex and the Process_O::_Active condition variable.
15:38:49
drmeister
Although if you have threads running - it ends badly. We don't yet have the main thread shutting down children.