Subj : Re: since ya'll are asking.
To   : Mark Lewis
From : Chris Hoppman
Date : Mon Dec 15 2003 11:35 am

ML>  CH> For A := 0 to 100 do
ML>  CH>     begin
ML>  CH>      {Do some stuff here}
ML>  CH>      TimeSlice;
ML>  CH>     end;
ML>  CH> It would do 100 timeslices back to back.

ML> as for when i call my slicing/sleeping stuff, that depends on my program an
ML> what its doing at the time... if i'm doing a lot of disk processing, i migh
ML> sleep every 50 records processed or every 100 lines read... if its pretty m
ML> memory intensive, i may sleep after each second... it really depends... one
ML> my applications uses both time based and processing based slicing calls...
ML> during intensive disk processing, it uses record based slicing and no timer
ML> based... the reason for this is to keep the effective processing speed of t
ML> program relatively bearable... if i sliced on each record or line read duri
ML> file processing, it may take a long long time for the program to finish wha
ML> it is doing but it would be very very very multitasker friendly... on the
ML> other hand, if i slice away only once per 1000 records processed, the
ML> application would do the disk processing very fast but be very multitasker
ML> unfriendly...

This is stuff I can use, cause what I was doing was had it release a slice not
in a wait procedure, but in times it is getting input and you said it would
freeze the program and take a long time to complete.  This is helpful.  Cause
if it is running a task. I should wait a while, before giving up a timeslice,
but when it is just waitting for input I should give up a timeslice each time.
(tell it to sleep).., because it is sorta not processing anything until input
is givin'.

ML> what operating system, version and timeslice style?? all three are needed t
ML> be known... there are several ways of timeslicing... choosing the proper on
ML> depends on the operating system and in some cases, which version of the
ML> operating system...

Basicly you gave me the ones that I have already. (not the code, but
told me the ones).  OS/2-Desqview-Windows(real mode)-DOS. All versions
:)~. I need to know about Win2k though..

ML> FWIW: the only difference between my Warp3 and Warp4 slicing is the Warp3
ML> stuff is set to sleep for 2ms whereas the Warp4 stuff is set to 0 (meaning
ML> "sleep now!")...

?..
Do you mean that a timeslice pauses your program or ie sleep.  I sorta
understand this part, but just wantted to make sure.

ML> i don't know that i can show the entire code setup that i use because there
ML> some inline asm as well as numerous asm routines mixed in with the pascal..
ML> can possibly post the actual slicing calls if desired... i had to play with
ML> them and work some things out for myself... some of my experimenting did ca
ML> lockups and lost data...

That is alright I already have code your talking about, but just wantted to
understand the way it works better and find out proper ways of using it.
You have taught me a few things.


1: TimeSlices pauses your program and lets other process to run.
  or also called sleep.

2: So, it is best to do a timeslice when your program isn't doing
  heavy processing. If you do a timeslice in this processing
  don't do it back to back, let the program run for a while
  before giving one up or it will take a long time to finish
  what it is doing.  On the other hand if you don't give one
  after a certain time the OS will suffer from lack of (for
  lack of words) cpu time.

3: Try to give up timeslices when your program is idle, like
  waitting for input.  Then process that input and while
  processing that input see #2.

4: It do mader when and where a timeslice is in the code. See
  #1, #2, #3.

;)
chris

--- Renegade v11-26.3 DOS
* Origin: The Titantic BBS Telnet - ttb.slyip.com (1:129/305)