1. Eu Threading -- Cheap Threads

I've seen several posts about threads here.  So far, it seems 
threads are not implemented.  So, I found this LGPL C lib called
"Cheap Threads" that might be helpful for someone willing to 
implement it for Eu.  Not sure it will help but, here is the
URL anyway...

http://home.swbell.net/mck9/ct/

new topic     » topic index » view message » categorize

2. Re: Eu Threading -- Cheap Threads

The thing is, threads do *kinda* work in Euphoria using the Windows
API. I've played around with it, and I could get multiple threads to
execute concurrently so long as each thread killed itself prior to
exiting. Allowing the thread to return 0 (normal behavior) causes a
machine crash, but killing the thread first works. I can dig up my
research if anyone is interested.

~Greg


On Mon, 20 Sep 2004 12:00:04 -0700, Ron Weidner <guest at rapideuphoria.com>
wrote:
> 
> posted by: Ron Weidner <nova812 at hotmail.com>
> 
> I've seen several posts about threads here.  So far, it seems
> threads are not implemented.  So, I found this LGPL C lib called
> "Cheap Threads" that might be helpful for someone willing to
> implement it for Eu.  Not sure it will help but, here is the
> URL anyway...
> 
> http://home.swbell.net/mck9/ct/
> 
> 
> 
>

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

3. Re: Eu Threading -- Cheap Threads

Greg Haberek wrote:
> 
> The thing is, threads do *kinda* work in Euphoria using the Windows
> API. I've played around with it, and I could get multiple threads to
> execute concurrently so long as each thread killed itself prior to
> exiting. Allowing the thread to return 0 (normal behavior) causes a
> machine crash, but killing the thread first works. I can dig up my
> research if anyone is interested.
> 
> ~Greg
Greg,

I'd be interested in seeing what you have if you're willing to share.

Jonas Temple
http://www.yhti.net/~jktemple

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

4. Re: Eu Threading -- Cheap Threads

Ron Weidner wrote:
> I've seen several posts about threads here.  So far, it seems 
> threads are not implemented.  So, I found this LGPL C lib called
> "Cheap Threads" that might be helpful for someone willing to 
> implement it for Eu.  Not sure it will help but, here is the
> URL anyway...
> 
> <a href="http://home.swbell.net/mck9/ct/">http://home.swbell.net/mck9/ct/</a>

What he's talking about here is not threads in the usual sense,
but rather "cooperative multitasking". It's the same idea that
the "Language War" demo program uses. In fact, he gives an example
of a star wars type game. If I were paranoid, I'd suspect that he
got the idea from Language War. See euphoria\demo\langwar
and look at the comments in sched.e

True "pre-emptive" threads might be added to Euphoria some day,
but it would be a big project, as I've discussed before.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

5. Re: Eu Threading -- Cheap Threads

On Mon, 20 Sep 2004 17:53:31 -0400, Elliott Sales de Andrade
<quantum_analyst at hotmail.com> wrote:

>    It's not really the problem of finding a library to wrap, but the fact
>that certain things in Eu just don't work with threads. There are certain
>register variables or memory structures that aren't quite thread-safe.

I'd be quite interested in understanding more about that, and having a
hack at making some (hopefully rather simple) example work.

I have not come from a thread-aware/supporting language background,
so some trivial examples you believe _should_ work would be best.

Regards
Pete

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

6. Re: Eu Threading -- Cheap Threads

On 20 Sep 2004, at 14:57, Robert Craig wrote:

> 
> 
> posted by: Robert Craig <rds at RapidEuphoria.com>
> 
> Ron Weidner wrote:
> > I've seen several posts about threads here.  So far, it seems 
> > threads are not implemented.  So, I found this LGPL C lib called
> > "Cheap Threads" that might be helpful for someone willing to 
> > implement it for Eu.  Not sure it will help but, here is the
> > URL anyway...
> > 
> > <a
> > href="http://home.swbell.net/mck9/ct/">http://home.swbell.net/mck9/ct/</a>
> 
> What he's talking about here is not threads in the usual sense,
> but rather "cooperative multitasking". It's the same idea that
> the "Language War" demo program uses. In fact, he gives an example
> of a star wars type game. If I were paranoid, I'd suspect that he
> got the idea from Language War. See euphoria\demo\langwar
> and look at the comments in sched.e
> 
> True "pre-emptive" threads might be added to Euphoria some day,
> but it would be a big project, as I've discussed before.

<cough> Al Getz's "windows server" </cough>

Kat

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

7. Re: Eu Threading -- Cheap Threads

On 20 Sep 2004, at 23:44, Pete Lomax wrote:

> 
> 
> On Mon, 20 Sep 2004 17:53:31 -0400, Elliott Sales de Andrade
> <quantum_analyst at hotmail.com> wrote:
> 
> >    It's not really the problem of finding a library to wrap, but the fact
> >that certain things in Eu just don't work with threads. There are certain
> >register variables or memory structures that aren't quite thread-safe.
> 
> I'd be quite interested in understanding more about that, and having a
> hack at making some (hopefully rather simple) example work.
> 
> I have not come from a thread-aware/supporting language background,
> so some trivial examples you believe _should_ work would be best.

Thread/Process, it's all the same if you disregard assorted "standards" and 
API implementations. If you have separate processes that can pass msgs 
back and forth, trigger interrupts in each other, kill or start each other, etc,
then it's the same, imo. In fact, having separate processes in separate 
space seems an advantage to me. As for threads, i was happy that Al Getz 
reinvented win3.1 in Euphoria source to run on other win platforms!

Kat

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

8. Re: Eu Threading -- Cheap Threads

On Mon, 20 Sep 2004 18:29:57 -0500, Kat <gertie at visionsix.com> wrote:

<snip>
>In fact, having separate processes in separate 
>space seems an advantage to me. As for threads, i was happy that Al Getz 
>reinvented win3.1 in Euphoria source to run on other win platforms!

I totally agree, though I use Thomas Parslow's ipc.ew as it is open
source, pure Euphoria, and at 11K unpacked, one tenth (or even
eightieth) the size. Plus, you don't need a background process.
Personal, blinkered, opinion, of course blink)

Pete

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

9. Re: Eu Threading -- Cheap Threads

Ron Weidner wrote:
> 
> I've seen several posts about threads here.  So far, it seems 
> threads are not implemented.  So, I found this LGPL C lib called
> "Cheap Threads" that might be helpful for someone willing to 
> implement it for Eu.  Not sure it will help but, here is the
> URL anyway...
> 
> <a href="http://home.swbell.net/mck9/ct/">http://home.swbell.net/mck9/ct/</a>
> 

spatcula?

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

10. Re: Eu Threading -- Cheap Threads

>From: Pete Lomax <petelomax at blueyonder.co.uk>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: Re: Eu Threading -- Cheap Threads
>Date: Mon, 20 Sep 2004 23:44:28 +0100
>
>On Mon, 20 Sep 2004 17:53:31 -0400, Elliott Sales de Andrade
><quantum_analyst at hotmail.com> wrote:
>
> >    It's not really the problem of finding a library to wrap, but the=
=20
>fact
> >that certain things in Eu just don't work with threads. There are certai=
n
> >register variables or memory structures that aren't quite thread-safe.
>
>I'd be quite interested in understanding more about that, and having a
>hack at making some (hopefully rather simple) example work.
>
>I have not come from a thread-aware/supporting language background,
>so some trivial examples you believe _should_ work would be best.
>

I'm no expert, so don't quote me on that. I'm just going by what Robert
said.
You can try this example: http://wingzone.tripod.com/basswma.zip You should=
=20
be
able to choose a sample rate, and press start. Then it will broadcast your
stereo mix over WMA, and after the window closes, print 543546 and wait for=

you to press a key. What I see is Euphoria exiting from the WinMain()
routine,
but the window hasn't closed, and printing 543546 and waiting for a key.=
=20
Then
it crashes because the encoding is trying to continue in the background.=
=20
Now,
the encoding (or maybe recording, one of em) is supposed to be running in a=

seperate thread in Bass. Perhaps it is just a mistake I made in the code=
=20
(but
that could /never/ happen, right??), and it would be a llot easier if it=
=20
were.
Unfortunately, my example is only Windows, but I get a couple people lookin=
g
over the code who might fix it, so.... If you want cross-platform ones, I
might be able to dig them up.

>Regards
>Pete
>

~[ WingZone ]~
http://wingzone.tripod.com/

=20
Technology=20=20
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=10=
34&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines=20
  Start enjoying all the benefits of MSN=AE Premium right now and get the=
=20
first two months FREE*.

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

11. Re: Eu Threading -- Cheap Threads

>From: Elliott Sales de Andrade <quantum_analyst at hotmail.com>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: Re: Eu Threading -- Cheap Threads
>Date: Wed, 22 Sep 2004 21:09:38 -0400
>
>>From: Pete Lomax <petelomax at blueyonder.co.uk>
>>Reply-To: EUforum at topica.com
>>To: EUforum at topica.com
>>Subject: Re: Eu Threading -- Cheap Threads
>>Date: Mon, 20 Sep 2004 23:44:28 +0100
>>
>>On Mon, 20 Sep 2004 17:53:31 -0400, Elliott Sales de Andrade
>><quantum_analyst at hotmail.com> wrote:
>>    It's not really the problem of finding a library to wrap, but the fac=
t
>>that certain things in Eu just don't work with threads.
>>There are certain
>> >register variables or memory structures that aren't quite thread-safe.
>>
>>I'd be quite interested in understanding more about that, and having a
>>hack at making some (hopefully rather simple) example work.
>>
>>I have not come from a thread-aware/supporting language background,
>>so some trivial examples you believe _should_ work would be best.
>>
>
>I'm no expert, so don't quote me on that. I'm just going by what Robert=

>said.
>You can try this example: http://wingzone.tripod.com/basswma.zip You shoul=
d
>be able to choose a sample rate, and press start. Then it will broadcast=

>your stereo mix over WMA.
>Now, the encoding (or maybe recording, one of em) is supposed to be runnin=
g
>in a seperate thread in Bass. Perhaps it is just a mistake I made in the=

>code, and it would be a llot easier if itwere.

  Should use http://wingzone.tripod.com/files/basswma.htm instead.

>>Regards
>>Pete
>>
>

~[ WingZone ]~
http://wingzone.tripod.com/


Technology.=20
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=10=
34&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines=20
  Start enjoying all the benefits of MSN=AE Premium right now and get the=

first two months FREE*.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu