RE: Threads [Was: Re: 64 bit euphoria]

new topic     » goto parent     » topic index » view thread      » older message » newer message

Mario,

I think threads do have their programming niche but the vast majority of 
apps don't need them, eg:

www.cs.utah.edu/~regehr/research/ouster.pdf 

> posted by: Mario Steele <eumario at trilake.net>
> 
> Mike wrote:
> > API function ReadFileEx() will load in a file asynchronously (in the 
> > background)
> > and then notify the user upon completion. (The progress bar is not even 
> > needed in
> > this case.)
> 
> Okay, first off with this, I wasn't refering to ReadFileEx(), or such 
> things
> as that, cause you also have to think, that ReadFileEx() loads a file 
> into
> memory, and should that file be a graphical file, still needs to be 
> decoded
> by your target graphics library.

A file that requires a substantial amount of contiguous decoding *time* 
may benefit by running in a separate thread so that the rest of the app 
doesn't 'hang' for a bit. But, apart from action games or an Internet 
browser when would this ever be a problem?

> Then try to make it cross-platform compatable.  As in, it can
> run just as it sits on both windows, and linux.

Cross-platform compatibility is really a separate issue. So long as the 
interface between app and xlibraries is the same then there is no 
problem but it's up to the library writers to ensure this.

> > I think threads are better than sub-processes but I was hoping you'd 
> > supply a real-life
> > example of this superiority that *couldn't* be satisfactorily 
> > accomodated using the
> > above suggested model.
> > 
> > Regards,
> > Mike
> 
>How many
> Euphoria programmers have successfully created Editor Programs, that can
> match the speed of C/C++ Editors out there, in syntax highlighting 
> speeds?
> (True, Edita is very close, but it still lags on Win32lib, even on a 
> 2.12GHz
> proccessor, I know, cause I have tried it.)

Sure, on my <ahem> 0.15 GHz system there is a slight delay when loading 
the file but this is a consequence of the direct programming technique 
used. However, after a file has loaded the screen rendering code in 
Edita executes (simultaneously) in the background. There is no technical 
reason why loading a file (NOT using ReadFileEx()) in the background 
can't be done in the same manner. Earlier, you suggested (nay, 
challenged) that a Source Code Viewer, such as ex13.exw, could not be 
developed [in Euphoria] having satisfactory speed. Obviously, it can be, 
but it's success depends on whether each individual task can be 
performed iteratively. In this case the answer must be yes as each line 
can be processed individually.

> One final note that I'd like to make, as this is actually, the perfect
> real-life example, I think your looking for.  How many Libraries out 
> there
> can do MD5 Encryption, Blowfish Encryption, or any kind of Encryption
> algorithim on the market, without resorting to using Assembly to speed 
> it
> up?

If the algorithm is iterative (ie, not continuous) it can occur in the 
background essentially seamlessly. If not then we have a problem. Sure, 
ASM is used to boost the speed of many algorithms but mainly because 
(interpreted) Euphoria is slow in comparison rather than to achieve an 
appearance of concurrency.

Regards,
Mike

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu