Commit fda3b369 authored by David Kågedal's avatar David Kågedal
Browse files

Började implementera prefetch av text-listor, men det är inte klart.

parent 689eb335
......@@ -307,26 +307,26 @@ prefetched the prefetch is not done."
;; (lyskom-stack-push lyskom-prefetch-stack (list 'CONF-TEXTS text-list))))
;; (lyskom-continue-prefetch))
(defun lyskom-prefetch-text-list (text-list &optional queue)
(defun lyskom-prefetch-texts (texts &optional queue)
"Prefetches a list of texts."
(if (text-list->empty text-list)
(if (null texts)
nil
(if queue
(lyskom-queue-enter queue
(list 'TEXT-LIST (text-list->texts text-list)))
(list 'TEXTS texts))
(lyskom-stack-push lyskom-prefetch-stack
(list 'TEXT-LIST (text-list->texts text-list)))))
(list 'TEXTS texts))))
(lyskom-continue-prefetch))
(defun lyskom-prefetch-text-list-continue (texts &optional queue)
"Prefetches a list of texts."
(if (null texts)
nil
(if queue
(lyskom-queue-enter queue (list 'TEXT-LIST-CONT texts))
(lyskom-stack-push lyskom-prefetch-stack
(list 'TEXT-LIST-CONT texts))))
(lyskom-continue-prefetch))
;; (defun lyskom-prefetch-text-list-continue (texts &optional queue)
;; "Prefetches a list of texts."
;; (if (null texts)
;; nil
;; (if queue
;; (lyskom-queue-enter queue (list 'TEXT-LIST-CONT texts))
;; (lyskom-stack-push lyskom-prefetch-stack
;; (list 'TEXT-LIST-CONT texts))))
;; (lyskom-continue-prefetch))
;;; ================================================================
......@@ -414,7 +414,7 @@ Return t if an element was prefetched, otherwise return nil."
;; A simple request?
((and (listp element)
(memq (car element)
'(CONFSTAT PERSSTAT TEXTSTAT TEXTMASS TEXT-LIST-CONT)))
'(CONFSTAT PERSSTAT TEXTSTAT TEXTMASS)))
(setcar prefetch-list 'DONE)
(lyskom-prefetch-one-request element nil)
(setq result t))
......@@ -424,7 +424,7 @@ Return t if an element was prefetched, otherwise return nil."
(memq (car element)
'(TEXTAUTH TEXT-ALL TEXTTREE
CONFSTATFORMAP MAP MARKS
MEMBERSHIP WHOBUFFER TEXT-LIST)))
MEMBERSHIP WHOBUFFER TEXTS)))
(let ((queue (lyskom-queue-create)))
(setcar prefetch-list queue)
(lyskom-prefetch-one-request element queue)
......@@ -522,8 +522,8 @@ Return t if an element was prefetched, otherwise return nil."
(initiate-get-marks 'prefetch 'lyskom-prefetch-marks-handler queue))
((eq (car request) 'WHOBUFFER)
(initiate-who-is-on 'prefetch 'lyskom-prefetch-whobuffer-handler queue))
((or (eq (car request) 'TEXT-LIST) (eq (car request) 'TEXT-LIST-CONT))
(initiate-get-text-stat 'prefetch 'lyskom-prefetch-text-list-handler
((eq (car request) 'TEXTS)
(initiate-get-text-stat 'prefetch 'lyskom-prefetch-texts-handler
(car (nth 1 request))
(cdr (nth 1 request))
queue))
......@@ -686,7 +686,7 @@ Maps are `cached' in lyskom-to-do-list."
(-- lyskom-pending-prefetch)
)
(defun lyskom-prefetch-text-list-handler (text-stat texts queue)
(defun lyskom-prefetch-texts-handler (text-stat texts queue)
"Prefetch all info neccessary to write the text with text-stat TEXT-STAT.
Put the requests on QUEUE."
(lyskom-stop-prefetch)
......@@ -709,9 +709,9 @@ Put the requests on QUEUE."
((eq type 'FOOTN-TO)
(lyskom-prefetch-textauth (misc-info->footn-to misc) queue))
(t nil))))
(if (null texts)
(and queue (lyskom-queue-enter queue 'FINISHED))
(lyskom-prefetch-text-list-continue texts queue))
(lyskom-queue-enter queue 'FINISHED)
;; The queue is now used up.
(lyskom-prefetch-texts texts)
(-- lyskom-pending-prefetch)
(lyskom-start-prefetch))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment