Commit 834ff123 authored by Linus Tolke's avatar Linus Tolke
Browse files

Continueing the prefetch-rewrite. The bugs get obscurer and obscurer.

parent 831db80f
Mon Aug 3 05:55:46 1992 Linus Tolke Y (linus@robin)
* async.el (lyskom-conf-fetched-p): required function.
* lyskom-rest.el (lyskom-go-to-next-conf): Prefetch of all
text-trees started on entrance.
(lyskom-end-of-command): Try to shut of prefetch while fetching
text to get next prompt.
* prefetch.el (lyskom-prefetch-limit): limit = 1;
MEMBERSHIPISREAD: new special type.
(lyskom-prefetch-one-item): Bugfix. lyskom-prefetch-textauth
shall fetch text-stat first.
(lyskom-prefetch-textauth-handler,
lyskom-prefetch-texttree-handler): handle error. This is needed
in all the prefetch-function handlers.
* startup.el (lyskom-fetch-until-we-have-an-unread): New function
to be called from lyskom-end-of-command.
(lyskom-decide-unread-conf): sets lyskom-membership-is-read to t.
Sat Aug 1 17:45:37 1992 Linus Tolke Y (linus@robin) Sat Aug 1 17:45:37 1992 Linus Tolke Y (linus@robin)
* prefetch.el (lyskom-prefetch-membership-handler, * prefetch.el (lyskom-prefetch-membership-handler,
......
...@@ -371,7 +371,21 @@ The text is converted, before insertion." ...@@ -371,7 +371,21 @@ The text is converted, before insertion."
;; Give a message if the user is waiting. ;; Give a message if the user is waiting.
(lyskom-run 'async 'lyskom-default-new-text-hook text-stat) (lyskom-run 'async 'lyskom-default-new-text-hook text-stat)
(lyskom-run 'async 'lyskom-prefetch-and-print-prompt)) (lyskom-run 'async 'lyskom-print-prompt))
(defun lyskom-conf-fetched-p (conf-no)
"Return t if CONF-NO has been prefetched."
(let ((n (1- (length lyskom-membership)))
(result nil))
(while (and (not result)
(>= n 0))
(if (= (membership->conf-no (elt lyskom-membership n))
conf-no)
(setq result t))
(-- n))
result))
(defun lyskom-add-new-text (recipient text-no local-no) (defun lyskom-add-new-text (recipient text-no local-no)
......
No preview for this file type
...@@ -124,7 +124,7 @@ See further documentation in the source code.") ...@@ -124,7 +124,7 @@ See further documentation in the source code.")
;+++These should really be in vars.el: ;+++These should really be in vars.el:
(defvar lyskom-prefetch-limit 2 (defvar lyskom-prefetch-limit 1
"Number of prefetch requests the client will try to keep going "Number of prefetch requests the client will try to keep going
at a time.") at a time.")
...@@ -147,9 +147,11 @@ at a time.") ...@@ -147,9 +147,11 @@ at a time.")
"Prefetch the conf-stat for the conference with number CONF-NO. "Prefetch the conf-stat for the conference with number CONF-NO.
If QUEUE is non-nil, put the request on it, otherwise put it on If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack." lyskom-prefetch-stack."
(if conf-no
(if queue (if queue
(lyskom-queue-enter queue (cons 'CONFSTAT conf-no)) (lyskom-queue-enter queue (cons 'CONFSTAT conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'CONFSTAT conf-no))) (lyskom-stack-push lyskom-prefetch-stack (cons 'CONFSTAT conf-no)))
(signal 'lyskom-internal-error "No argument to lyskom-prefetch-conf"))
(lyskom-continue-prefetch)) (lyskom-continue-prefetch))
...@@ -360,7 +362,7 @@ Return t if an element was prefetched, otherwise return nil." ...@@ -360,7 +362,7 @@ Return t if an element was prefetched, otherwise return nil."
;; Special request ;; Special request
((and (listp element) ((and (listp element)
(eq (car element 'MEMBERSHIPISREAD))) (eq (car element) 'MEMBERSHIPISREAD))
(setq lyskom-membership-is-read t)) (setq lyskom-membership-is-read t))
(t (signal 'lyskom-internal-error (t (signal 'lyskom-internal-error
...@@ -389,7 +391,7 @@ Return t if an element was prefetched, otherwise return nil." ...@@ -389,7 +391,7 @@ Return t if an element was prefetched, otherwise return nil."
((eq (car request) 'TEXTMASS) ((eq (car request) 'TEXTMASS)
(initiate-get-text 'prefetch 'lyskom-prefetch-handler (cdr request))) (initiate-get-text 'prefetch 'lyskom-prefetch-handler (cdr request)))
((eq (car request) 'TEXTAUTH) ((eq (car request) 'TEXTAUTH)
(initiate-get-text 'prefetch 'lyskom-prefetch-textauth-handler (initiate-get-text-stat 'prefetch 'lyskom-prefetch-textauth-handler
(cdr request) queue)) (cdr request) queue))
((eq (car request) 'TEXT-ALL) ((eq (car request) 'TEXT-ALL)
(initiate-get-text-stat 'prefetch 'lyskom-prefetch-text-all-handler (initiate-get-text-stat 'prefetch 'lyskom-prefetch-text-all-handler
...@@ -435,8 +437,10 @@ Return t if an element was prefetched, otherwise return nil." ...@@ -435,8 +437,10 @@ Return t if an element was prefetched, otherwise return nil."
"Prefetch the conf-stat of the author of the text TEXT-STAT. "Prefetch the conf-stat of the author of the text TEXT-STAT.
Put the request on QUEUE." Put the request on QUEUE."
(lyskom-stop-prefetch) (lyskom-stop-prefetch)
(if (not text-stat)
nil
(lyskom-prefetch-conf (text-stat->author text-stat) queue) (lyskom-prefetch-conf (text-stat->author text-stat) queue)
(lyskom-queue-enter queue 'FINISHED) (lyskom-queue-enter queue 'FINISHED))
(-- lyskom-pending-prefetch) (-- lyskom-pending-prefetch)
(lyskom-start-prefetch)) (lyskom-start-prefetch))
...@@ -473,6 +477,8 @@ Put the requests on QUEUE." ...@@ -473,6 +477,8 @@ Put the requests on QUEUE."
"Prefetch all info neccessary to write the text with text-stat TEXT-STAT. "Prefetch all info neccessary to write the text with text-stat TEXT-STAT.
Then prefetch all info (texttree) of comments. Then prefetch all info (texttree) of comments.
Put the requests on QUEUE." Put the requests on QUEUE."
(if (not text-stat)
nil ; We did not get anything
(lyskom-stop-prefetch) (lyskom-stop-prefetch)
(lyskom-prefetch-conf (text-stat->author text-stat) queue) (lyskom-prefetch-conf (text-stat->author text-stat) queue)
(lyskom-prefetch-textmass (text-stat->text-no text-stat) queue) (lyskom-prefetch-textmass (text-stat->text-no text-stat) queue)
...@@ -493,7 +499,7 @@ Put the requests on QUEUE." ...@@ -493,7 +499,7 @@ Put the requests on QUEUE."
((eq type 'FOOTN-TO) ((eq type 'FOOTN-TO)
(lyskom-prefetch-textauth (misc-info->footn-to misc) queue)) (lyskom-prefetch-textauth (misc-info->footn-to misc) queue))
(t nil)))) (t nil))))
(lyskom-queue-enter queue 'FINISHED) (lyskom-queue-enter queue 'FINISHED))
(-- lyskom-pending-prefetch) (-- lyskom-pending-prefetch)
(lyskom-start-prefetch)) (lyskom-start-prefetch))
......
...@@ -255,6 +255,7 @@ Optional argument CONF-STAT is used to check for a msg-of-day on the person." ...@@ -255,6 +255,7 @@ Optional argument CONF-STAT is used to check for a msg-of-day on the person."
(not (zerop (conf-stat->no-of-texts conf-stat)))) (not (zerop (conf-stat->no-of-texts conf-stat))))
(lyskom-insert-string 'presentation-encouragement)) (lyskom-insert-string 'presentation-encouragement))
(lyskom-setup-prefetch) (lyskom-setup-prefetch)
(lyskom-stop-prefetch)
(setq lyskom-membership-is-read 0) (setq lyskom-membership-is-read 0)
(setq lyskom-membership nil) (setq lyskom-membership nil)
(setq lyskom-command-to-do 'unknown) (setq lyskom-command-to-do 'unknown)
...@@ -321,6 +322,12 @@ Information required for this: ...@@ -321,6 +322,12 @@ Information required for this:
(let ((list (lyskom-array-to-list membership)) (let ((list (lyskom-array-to-list membership))
sent) sent)
(lyskom-add-membership-to-membership membership) (lyskom-add-membership-to-membership membership)
(lyskom-fetch-until-we-have-an-unread list)))
(defun lyskom-fetch-until-we-have-an-unread (&optional list)
"Call to fetch info until we have decided if we have an unread. (or are done."
(let ((sent))
(while (and (not sent) list) (while (and (not sent) list)
(if (and lyskom-unread-confs (if (and lyskom-unread-confs
(not (memq (membership->conf-no (car list)) (not (memq (membership->conf-no (car list))
...@@ -335,10 +342,11 @@ Information required for this: ...@@ -335,10 +342,11 @@ Information required for this:
(setq list (cdr list))) (setq list (cdr list)))
(if sent (if sent
nil nil
(if (numberp lyskom-membership-is-read)
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3 (initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3
lyskom-pers-no lyskom-pers-no
lyskom-membership-is-read lyskom-membership-is-read
lyskom-fetch-membership-length)) lyskom-fetch-membership-length)))
(let ((reverse (reverse lyskom-membership))) (let ((reverse (reverse lyskom-membership)))
(while reverse (while reverse
(lyskom-prefetch-conf (membership->conf-no (car reverse))) (lyskom-prefetch-conf (membership->conf-no (car reverse)))
...@@ -377,6 +385,7 @@ If not, fetch next conf-stat from REST-MEMBERSHIPLIST." ...@@ -377,6 +385,7 @@ If not, fetch next conf-stat from REST-MEMBERSHIPLIST."
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3 (initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3
lyskom-membership-is-read lyskom-membership-is-read
lyskom-fetch-membership-length) lyskom-fetch-membership-length)
(setq lyskom-membership-is-read t)
(lyskom-run 'main 'lyskom-start-anew-login-3 'cont))))) (lyskom-run 'main 'lyskom-start-anew-login-3 'cont)))))
......
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