Subj : since ya'll are asking.
To   : Chris Hoppman
From : mark lewis
Date : Mon Dec 15 2003 05:16 pm

[trim]

ML>> it is doing but it would be very very very multitasker
ML>> friendly... on the other hand, if i slice away only
ML>> once per 1000 records processed, the application would
ML>> do the disk processing very fast but be very
ML>> multitasker unfriendly...

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

yes, pretty much... glad i was able to confirm for you...

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

CH> Basicly you gave me the ones that I have already. (not the
CH> code, but told me the ones).  OS/2-Desqview-Windows(real mode)-DOS.
CH> All versions :)~.

ok... as i understand it TOPView also uses the DESQview slice call...

CH> I need to know about Win2k though..

AFAIK, i just use the same windows slice... i'm not aware of any other...

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

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

ummm... the 2 tells that routine to sleep for 2ms... 0 means sleep now and give
up /this/ slice... i forget why i ended up doing it that way but it had to do
with some change that IBM had put in Warp4... it may have changed in later
fixpacks for Warp4 but i've not updated and tested... since i've also had no
complaints, i can only assume that things are working as desired...

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

CH> That is alright I already have code your talking about, but
CH> just wantted to understand the way it works better and find
CH> out proper ways of using it.

you may very well have the stuff i have... i dunno... i've /lots/ of it... some
is similar, some is identicle and some is different... i just took what i
thought was the better and what i was able to understand and pieced it together
in my own way...

CH> You have taught me a few things.

excellent!

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

in so many words, yes, that's probably as accurate as we can get it...

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

right... if you slice while reading records, only slice after reading X number
of records... also note that this is not a fixed number, either... some tuning
is necessary...

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

right...

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

not that i'm aware of... i just added slicing to one of my languishing projects
and let it slice at the top of each loop thru the reading of the records and
processing of the datafiles... its simple counter program that gathers record
sizes from several datafiles for each record in the master datafile... if the
secondary files exist, i slice before reading and processing them... if they do
not exist, i don't slice... this gives me the fastest traversal thru the master
datafile and then decent speed while processing the secondary datafiles... i've
got a distributed computing project running on my system so it hovers about 50%
utilization all the time... this project of mine only taps it up a few
percent... i guess i should stop that background process and let my cpu usage
drop to 0% and then test my routines to see how badly they really do impact the
system...

)\/(ark


* Origin: (1:3634/12)