[Gambas-user] Multi threaded apps

Pino Zollo pinozollo at ...626...
Sat Sep 6 23:08:01 CEST 2008


Alle 06:10, sabato 6 settembre 2008, Benoit Minisini ha scritto:
> Gambas interpreter was not designed to be multi-threaded at all.
>
> What sort of background process people want to do during their application?
> I never had such a need.

When the applications does a lot of asynchronous input/output background 
processes simplify a lot the programmer's life and, possibly, the resilience 
of the full application.

You can think to objects as hardware components interconnected like chips on 
the motherboard.
Every one does his task and receives or sends data to other "objects" via a 
pipe in place of a copper wire.
When tcp/ip is involved any new connection on the same address, the same piece 
of code is instantiated  handling the new connection, letting the kernel the 
task of distributing the CPU power.

Just for having a look to applications that use heavily multitasking (or multi 
threads), my old applications in Modula-3 are available on my site 
(http://www.qsl.net/zp4kfx/Linux )

How these features can be implemented in GAMBAS I do not know not having any 
idea about how it is implemented. 

At the time of CP/M (does somebody remember it ?) and when the Z80 was running 
a 4 MHz,  a wonderfull programming language, named FORTH, had a good success 
and had a profound impact on my way of tinking programs...even now my gambas 
program is conceived with the same logic.
The BASIC of the HP-85 did share the same style:
Every line of BASIC code was compiled, like FORTH, as a sequence of addresses.
The interpreter had just to call in sequence those addresses.

In such a kind of BASIC multitasking is implemented easily. (In FORTH too).

and....yes I started with punched cards ;-)

Regards

Pino





More information about the User mailing list