1. Anyone else working on Threads for Euphoria?

Hello there,

Anyone else working on Threads for Euphoria?


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » topic index » view message » categorize

2. Re: Anyone else working on Threads for Euphoria?

A few month ago I started to wrap the win32api for threads then I read that 
for it to work,  the application must be compile with multithread library and 
the the test program I'have done failed so I guess that exw.exe is not compiled
compiled with multitrheads library.

Jacques d.

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

3. Re: Anyone else working on Threads for Euphoria?

I had it working, kinda. I could create multiple threads, but they did
not run concurrently, and I had to explictly call ExitThread() or the
code would crash. From what I've read though, ExitThread() is the
"preferred method" of exiting a thread in C, not just letting the
function end itself. So this may be correct behavior.

If I had 2 threads, and each thread incremented a counter from 1 to 10
and output the result for each increment, I'd typically end up with
this result, or something similar:

Thread 1:  1
Thread 1:  2
Thread 2:  1
Thread 2:  2
Thread 2:  3
Thread 2:  4
Thread 2:  5
Thread 2:  6
Thread 2:  7
Thread 2:  8
Thread 2:  9
Thread 2:  10
Thread 1:  3
Thread 1:  4
Thread 1:  5
Thread 1:  6
Thread 1:  7
Thread 1:  8
Thread 1:  9
Thread 1:  10

As you can see, the threads do not run concurrently as expected. Maybe
its because they run so fast, I don't know. I'm not too experienced
with threads, and I don't do C programming. But as far as theory goes,
it *did* work, in 100% Euphoria.

I can provide code if anyone would like to see it, although it is
pretty simple. In my opinion, I think one of our more experienced C
programmer friends should write a DLL that handle threads and calls Eu
functions from there, which would enhance the stability of threads in
Euphoria.

~Greg


On Mon, 24 Jan 2005 16:42:32 -0800, Al Getz <guest at rapideuphoria.com> wrote:
> 
> posted by: Al Getz <Xaxo at aol.com>
> 
> Hello there,
> 
> Anyone else working on Threads for Euphoria?
> 
> Take care,
> Al
> 
> And, good luck with your Euphoria programming!
> 
> My bumper sticker: "I brake for LED's"
> 
> 
> 
>

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

4. Re: Anyone else working on Threads for Euphoria?

On 24 Jan 2005, at 16:42, Al Getz wrote:

> 
> 
> posted by: Al Getz <Xaxo at aol.com>
> 
> Hello there,
> 
> Anyone else working on Threads for Euphoria?

<cough>
windows server
</cough>

except it seems to use win98 calls that don't exist in 95, so i cannot use it.

Kat

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

5. Re: Anyone else working on Threads for Euphoria?

Hello again,

There were a number of responses so i grouped my replies all into
one message post...


Chris:
Mic?  Where can he be reached?

Jacques:
Oh ok, i guess you were going to use the Win32api C function calls then?

Kat:
Windows server?  What's that?

Greg:
Sounds interesting.  I'd like to hear a few more details about your
implementation technique.  It doesnt look that bad really and i think
mine is somewhat like that too, as they end up nested...

if n^th thread then
  if third thread then
    if second thread then
      if main thread then
        finish main
      end if
      finish second
    end if
    finish third
  end if
  finish n^th
end if

which still works out pretty well since new threads are created 'automatically'.
Also, the same functions can be used as long as the code can be re-entered.
Each thread gets to use it's own instance (via private vars).

I'd like to hear some details about how yours works Greg.
Im looking into other ways of doing it too.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

6. Re: Anyone else working on Threads for Euphoria?

On 25 Jan 2005, at 0:05, Al Getz wrote:

> 
> 
> posted by: Al Getz <Xaxo at aol.com>
> 
> Hello again,

<snip>

> Kat:
> Windows server?  What's that?

Your code at http://www.rapideuphoria.com/displayserver206.zip !! You may 
have written it to serve multiple programs to one window, but the key phrase 
here is "multiple programs" , aka "multiple threads" since they can talk to 
each other thru the server.

Kat

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

7. Re: Anyone else working on Threads for Euphoria?

Kat wrote:
> 
> On 25 Jan 2005, at 0:05, Al Getz wrote:
> 
> > 
> > posted by: Al Getz <Xaxo at aol.com>
> > 
> > Hello again,
> 
> <snip>
> 
> > Kat:
> > Windows server?  What's that?
> 
> Your code at <a
> href="http://www.rapideuphoria.com/displayserver206.zip">http://www.rapideuphoria.com/displayserver206.zip</a>
> !! You may
> have written it to serve multiple programs to one window, but the key phrase 
> here is "multiple programs" , aka "multiple threads" since they can talk to 
> each other thru the server.
> 
> Kat
> 
> 
Hi Kat,

Ohh, the "Display Server".  Yes, that's a good idea too.
I also didnt realize it didnt work on Win95, but does that
include the text writing too or just the picture displaying?
There's probably a way to get it working in Win95 too if
i know more about what the problem was.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

8. Re: Anyone else working on Threads for Euphoria?

hello,
Answer to Al: Yes I was using  win32api calls,
Anser to Greg: Yes I would like to see some working sample

Jacques d.

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

9. Re: Anyone else working on Threads for Euphoria?

On 25 Jan 2005, at 12:04, Al Getz wrote:

> 
> 
> posted by: Al Getz <Xaxo at aol.com>
> 
> Kat wrote:
> > 
> > On 25 Jan 2005, at 0:05, Al Getz wrote:
> > 
> > > 
> > > posted by: Al Getz <Xaxo at aol.com>
> > > 
> > > Hello again,
> > 
> > <snip>
> > 
> > > Kat:
> > > Windows server?  What's that?
> > 
> > Your code at <a
> >
> > href="http://www.rapideuphoria.com/displayserver206.zip">http://www.rapideupho
> > ria.com/displayserver206.zip</a> !! You may have written it to serve
> > multiple
> > programs to one window, but the key phrase here is "multiple programs" , aka
> > "multiple threads" since they can talk to each other thru the server.
> > 
> > Kat
> > 
> > 
> Hi Kat,
> 
> Ohh, the "Display Server".  Yes, that's a good idea too.
> I also didnt realize it didnt work on Win95, but does that
> include the text writing too or just the picture displaying?
> There's probably a way to get it working in Win95 too if
> i know more about what the problem was.

On 24 Jan 2005, at 11:25, Kat wrote:

<snip>

> (with Al's windows server, if i can fix it too. Al, see:
> http://Tiggrbox.info/temp/windows.jpg !! ) , instead of the official RDS
> version.
 
The text did work at one time, i don't know what broke. I wanted to use it 
with Matts new interpreter.

Kat

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

10. Re: Anyone else working on Threads for Euphoria?

Kat wrote:
>
>http://Tiggrbox.info/temp/windows.jpg
>
> Kat

Hi Kat,

If you display a picture before or after writing text (like a jpg)
and that picture also has text written in it then the overall
image might appear as if the text was typed over (strange)
because the written text and the pic are logically or'd to the
window.  The only way around this is to clear the text or make
sure the picture doesnt contain text or dont write to the server
when there is going to be a pic with text in it displayed.
The only way to change this default behaviour would be to overwrite
text when a pic is displayed.  Thing that would be good?
Sometimes i like to display a pic in the background and write text
over it.  Perhaps another function added to the Display Server?



Thanks, and take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

Search



Quick Links

User menu

Not signed in.

Misc Menu