Re: The fate of Euphoria
I posted this a while ago:
I think threads are needed in Euphoria. The example below would be
fairly easy to use. Many programs would benifit from this.
procedure new_thread(integer routine_id,sequence params,int priority)
new_thread() starts the thread and returns imediatly.
routine_id is the routine id for the procedure to run
params is "params must be a sequence of argument values of length n,
where n is the number of arguments required by the procedure. If the
procedure does not take any arguments then params should be {}."(copied
from manual: call_proc)
priority is somthing like HIGH, LOW, NORMAL, ABOVENORMAL, ect(this
would be nice, but I wouldn't really care if it wasn't implemented,
as long as there is a good reason for not implementing it.)
procedure a()
integer t
t=time()
for z=1 to 1000000 do
--do something that takes a lot of time here
end for
?time()-t --a fairly high number
end procedure
procedure b(integer i)
integer t
t=time()
for z=1 to 1000000 do
--do something that takes a lot of time here
end for
?time()-t --a fairly high number
end procedure
integer tt
tt=time()
new_thread(routine_id("a"),{},ABOVENORMAL)
new_thread(routine_id("b"),{rand(10)},LOW)
?time()-tt --would display a number near 0 because new_thread() returns
imediatly
richard koch wrote:
>
> I think that one of real things that are missing are threads. i asked a couple
> of
> times for it, - but somehow it doesn't seem to be usefull for others.
> eu is nice for little,little,little proggies (lacking threads), but for the
> things
>
> i need to do i have to use D or modula (sure there are other possibilities - i
>
> circumvent M$ and can port without change to linux).
> i can very well understand the problems people have and i hope there will be
> changes, since i like the concepts of this little language.
>
> best regards
>
> richard koch
>
|
Not Categorized, Please Help
|
|