laurent.orseau
2019-11-18 11:58:18

When using custodian-limit-memory, is there a way to know when a custodian has been shut down due to reaching the memory limit?


popa.bogdanp
2019-11-18 13:20:23

Is it possible for a dynamic-place to inherit the state of its parent place? I’m thinking of fork-like semantics. I assume not, but just wanted to double check in case I missed something. My specific use case is I have a central process that dispatches jobs to a pool of worker places and when those places boot up I need them to load the module that runs that central process. The way I have it set up right now, the central process sends each new place a module path and then each place dynamic-requires that module, but that can be pretty slow.


lexi.lambda
2019-11-18 13:55:14

@popa.bogdanp No, it isn’t possible. Though to be clear, the overhead should only happen on startup, right? Since you’re pooling the worker places (which is usually the right approach).


popa.bogdanp
2019-11-18 14:01:58

That’s right, the overhead is only at boot time so it’s not a huge deal. The reason I’d like it to be a bit faster is because the process will often be reloaded during development and waiting for the workers to boot up in those cases can be a bit annoying. I think what I’m going to do is defer some of that work by making the worker places require the module after they receive the first job rather than immediately when they start up.

Also, this1 feels a little bit icky/like it could come back to bite me later.


lexi.lambda
2019-11-18 14:06:33

Got it, that makes sense. You could possibly try to do some kind of live reloading in the individual places to avoid having to respawn them every time, via dynamic-rerequire, but that would certainly be more involved.


wwall
2019-11-18 14:30:20

hello is exists tutoral with CI/CD on gitlab with drraket project?


samth
2019-11-18 14:32:19

@wwall not for gitlab, but for github & travis there’s https://github.com/greghendershott/travis-racket and for github actions you can look at https://github.com/Bogdanp/setup-racket


wwall
2019-11-18 14:34:53

thanks


steveh2009
2019-11-18 15:44:27

I’m translating some Java code to Racket. For heavily overloaded methods, is it best to have a prefix name and then just number them (e.g. name–1, name–2, etc), essentially “de-overloading” the calls at the calling level?


mflatt
2019-11-18 17:20:53

No, that’s not reported/recorded anywhere. I think once created a nested custodian with a memory limit on the parent and only the child exposed, so that if the parent is shut down, it could only be due to the memory limit.


notjack
2019-11-18 17:48:40

@steveh2009 Can you use optional arguments to reduce the number of overloads needed?


laurent.orseau
2019-11-18 17:52:43

Ok thank you. It may be a good idea to document this and maybe to guarantee this somehow in the future, as currently it’s a little hard to assess how much I can rely on this.

The use case is a search algorithm that i need to kill on time-out or on out-of-memory.


wwall
2019-11-18 18:16:38

can somebody show example for struct-doc?


a.schutzelaars
2019-11-18 21:04:16

@a.schutzelaars has joined the channel


spdegabrielle
2019-11-18 22:34:06

Racket has a discord server! https://discord.gg/6Zq8sH5


spdegabrielle
2019-11-18 22:41:08

the reason for this is not discord features - it is that discord is popular and familiar for many who don’t use email, slack, google groups or reddit.


wanderley.guimaraes
2019-11-18 23:53:16

@wanderley.guimaraes has joined the channel


pavpanchekha
2019-11-19 00:14:59

What’s the relationship between thread and place? I was tipped off to place/context for simplifying my code, but my current code uses thread.


soegaard2
2019-11-19 00:30:53

Most programs use threads, which provides concurrency (the illusion of parallelism). If you need real parallelism (i.e. need more than one cpu), you can use places. Threads are the easiest to work with.


notjack
2019-11-19 01:40:18

@pavpanchekha Use thread to manage concurrent communication tasks (IO). Use places to manage parallel computation, i.e. CPU-bound work. Places are unlikely to help you much with IO-bound tasks like reading and writing files (or at least, they’re unlikely to do as well as threads and will be much harder to use.)


pavpanchekha
2019-11-19 04:37:58

Hmm, so I would convert to places, then? Herbie is very CPU bound.


notjack
2019-11-19 04:58:06

If you have tasks of the form “take smallish in-memory input messages, do lots of CPU work, produce smallish in-memory output messages”, then I think you will get a lot of benefit out of using places. I suspect a lot of Herbie falls into that bucket.


notjack
2019-11-19 05:00:06

It’s reasonable to use both threads and places in a large program. You take the CPU-intensive tasks and ship them off to worker places or place pools. Then the main place uses threads to manage IO and sending/receiving messages to worker places.


jim
2019-11-19 05:36:22

@jim has joined the channel


rj.amdphreak
2019-11-19 06:48:22

@soegaard2 You might be interested in a Zulip chat server. It supposedly detects topics and puts them into threads