1. MultiTasking/Threads

Well, actually Pete, they should not be allowed to just share variables, the
word messy, most definately comes to mind. I would prefer to I/O type of
communication for consistency and because we can easily use standard
routines.

We just need a way (maybe a function) to get the file handles of every
client-file in a thread) then we could juse use print (), get (), puts (),
gets () and getc ()..

However notice that shrouded files, using get () shrouded witht he normal
euphoria include files, might not work that nice with threads. I guess that
will be one of the biggest problems, is it gonna be a 100% clone, or are you
gonna rewrite/make some specific new include libraries.. ?

Ralf

new topic     » topic index » view message » categorize

2. Re: MultiTasking/Threads

Ralf Nieuwenhuijsen wrote:
>However notice that shrouded files, using get ()
>shrouded with the normal euphoria include files,
>might not work that nice with threads. I guess that
>will be one of the biggest problems, is it gonna be
>a 100% clone, or are you gonna rewrite/make some
>specific new include libraries.. ?
hrmmmm... how to load the code for a thread...
cannae be include, shrouding ixnay's that...
if we try and use a constant holding a sequence that
is simply straight EU code like:

   constant threadSpellCheck = {
        "for i=1 to length(document) do",
        "  if not find(document[i],dictionary) then",
        "       msgbox(\"you screwed up\")",
        "  end if end for"      }

i mean, that isn't such a bad way to code threads, since
they are most likely gonna be short.
but, no, i'm not real wild about it, and i'm not sure
what bind/shroud with string obfuscation turned on would do.

that leads me to some sort of alternate based on the above
method.  what about a thread compiler? it takes our
include file that holds the thread code within it. it then
spits out a sequence of byte codes dumped into another
file as a global constant sequence.
(like graeme's bmp to include thingy)
we then can bind and shroud *without* the string
hiding option turned on, cuz ain't noone gonna really
be able to read "bytecode" like they can a newspaper,
as a general rule...

still no good? we can hide the bytecodes within a bmp...
and the bmp (if we are slick) could actually load as a
bmp (for the nosy).

there is also the .dat file option... david's resource
compiler might prove usefull here? (dunno, haven't looked
at that one yet)

--hawke'

new topic     » goto parent     » topic index » view message » categorize

3. Re: MultiTasking/Threads

Im suprised I didnt think of this before.
All the thread handeling could just be done by Euphoria itself, except for
two little small additions:

1) We want a procedure that we can give Euphoria code in a sequence, after
which the code is handeled as any other normal include file. (global/local
scope rules). We should btw (suggestion for Euphoria 3) be able to overwrite
an already defined routine if it is in a different file. If the routine is
declared local then it does only rules over the code coming after that
routine until the end of the file, however if it is declared globally, it
will replace the older defined global routine, a warning message off course
is generated.

2) We want some operator like >> that handles multiline text, for example:

>>    -- Starting next line

This text, including all \\n is being read as one piece of text.
/>> this escape character is only for use within this 'text' pieces
-- Quotes do not exist here

<< -- This is how you end it

Reason for this:
simple messages in dialog's.. but also code, etc. can much easier be
included in an euphoric file.

Robert, such an new operator is a very nice addition, dont you think ?

Ralf

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu