unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [GNU ELPA] New package: tam
@ 2023-09-18  2:28 Lynn Winebarger
  2023-09-18  9:37 ` Philip Kaludercic
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Lynn Winebarger @ 2023-09-18  2:28 UTC (permalink / raw)
  To: emacs-devel

I'd like to submit "tam" (table allocation manager) for inclusion in
GNU ELPA.  The source is available at
https://github.com/owinebar/emacs-table-allocation-manager

tam provides functions to track the (manual) allocation of a fixed
number of resources to specific objects.  All the data structures of
the table are fixed at initialization, so that adding or removing a
particular object should not provoke a garbage collection in any
obvious way.  The allocation and deallocation are meant for use in
process sentinels and the like.

I have previously implemented some of the functionality of this
package in a package async-job-queue on MELPA.  However, since that
work cannot be assigned to the FSF, I am writing a more general
purpose async job scheduler from scratch.  In particular, the
scheduler will provide a facility for users to set a maximum number of
async processes to run simultaneously, then manage the assignment of
those process slots to jobs.  The tam functions provide a generic way
to manage that resource allocation in process sentinels.  tam.el was
created on September 15, 2023.

;;; tam.el --- Manage use of slots in a fixed size table  -*-
lexical-binding: t; -*-
;;; Commentary:

;; Table Allocation Manager
;; Provides an interface to managing the usage of the slots in a fixed size
;; table.  All allocation is done during initialization to avoid triggering
;; garbage collection during allocation/free operations.

;;  API:
;;
;;  (tam-create-table N) => table of size N
;;  (tam-table-fullp TABLE) => nil unless TABLE is full
;;  (tam-table-emptyp TABLE) => nil unless TABLE is empty
;;  (tam-table-size TABLE) => number of slots in TABLE
;;  (tam-table-used TABLE) => number of slots of TABLE in use
;;  (tam-table-get TABLE IDX) => contents of TABLE slot at index IDX
;;  (tam-allocate TABLE OBJ) =>
;;      if not full, assigns OBJ to contents of a free slot in TABLE,
;;                   and returns the index of the slot
;;      if full, returns nil
;;  (tam-free TABLE INDEX) =>
;;      if slot at INDEX of TABLE is in use, move to the free list and
;;              return the object formerly held by the slot
;;      if slot is already free, signal an error
;;  (tam-table-free-list TABLE) => list of free indices in TABLE
;;  (tam-table-live-list TABLE) => list of in-use indices in TABLE

Thanks,
Lynn



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-09-22 19:45 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18  2:28 [GNU ELPA] New package: tam Lynn Winebarger
2023-09-18  9:37 ` Philip Kaludercic
2023-09-18 16:22   ` Lynn Winebarger
2023-09-18 17:02     ` Philip Kaludercic
2023-09-19 15:38       ` Lynn Winebarger
2023-09-20  8:26         ` Philip Kaludercic
2023-09-20 16:14           ` Lynn Winebarger
2023-09-20 17:30             ` Stefan Monnier via Emacs development discussions.
2023-09-21  4:21               ` Lynn Winebarger
2023-09-21 13:59                 ` Stefan Monnier
2023-09-22  3:01                   ` Lynn Winebarger
2023-09-22  3:23                     ` Stefan Monnier
2023-09-21 16:38             ` Philip Kaludercic
2023-09-18 19:26 ` Adam Porter
2023-09-19 15:48   ` Lynn Winebarger
2023-09-19 16:29     ` Adam Porter
2023-09-21 20:26     ` Richard Stallman
2023-09-22 19:45       ` Adam Porter
2023-09-20 16:06 ` Stefan Monnier
2023-09-20 16:44   ` Lynn Winebarger

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).