<div dir="ltr"><div><div><div><div><div>Marc,<br><br></div>Could we add thread-cells? <br>They can be easily implemented with a per-thread hash-table, that only gets initialized if accessed.<br><br>They are incredibly useful for per thread caches, and probably a lot of other things.<br></div><br>For instance, I have this common pattern that i see a lot:<br><br>(def errptr-cache<br>  (make-hash-table-eq weak-keys: #t))<br>(def errptr-cache-mutex<br>  (make-mutex))<br><br>(def (get-errptr)<br>  (with-lock errptr-cache-mutex<br>    (lambda ()<br>      (cond<br>       ((hash-get errptr-cache (current-thread))<br>        => (lambda (errptr)<br>             (errptr_clear errptr)<br>             errptr))<br>       (else<br>        (let (errptr (check-ptr get-errptr (make_errptr)))<br>          (hash-put! errptr-cache (current-thread) errptr)<br>          errptr))))))<br><br></div>and I would like to eliminate both the lock and the weak table.<br></div></div><div><br></div><div>I can add it and make a pr, but I wanted to consult with you first.<br></div><div><br></div>-- vyzo<br></div>