Re: Single instance module and multithreading

From: Vyacheslav Egorov <v.e.ego....at.gmail.com>
Date: Sun, 22 Feb 2009 17:37:57 +0600

Hi Benjamin,

To put it simple: IMHO sharing is evil :)

I think TA should adopt approach which is common for GUI libraries: only a
single thread should have access to the real "controls" (to textadept table,
in your terms) and all others should send requests to this thread.

In fact before choosing a threading abstraction we should first collect
different use cases. Then we should assess threading abstractions according
to their applicability to those different use cases.
We should *taste* the code and feel the difference between them before
choosing something.

--
e.v.e
On Sun, Feb 22, 2009 at 5:13 PM, helgoboss <benjamin.k....at.gmail.com> wrote:
>
> Hello Vyacheslav,
>
> the problem with LuaLanes is that the threads don't share global data.
> I see no way how to control Textadept from a second thread if it can't
> access the "textadept" table. LuaLanes uses copying to share data
> between threads, but copying the "textadept" table makes no sense.
> I've also looked into LuaThread which seems to be the only threading
> approach that allows sharing of global data, but it needs a modified
> lua.dll and I couldn't get it to work in Lua 5.1.
>
> Regards
> Benjamin
>
>
>
> On 22 Feb., 06:47, Vyacheslav Egorov <v.e.ego....at.gmail.com> wrote:
> > Hi,
> >
> > Maybe it is better to use some 3rd party library instead of
> (re)implementing
> > threading support from scratch?
> > LuaLanes <http://luaforge.net/projects/lanes/> looks quite interesting:
> it
> > supports three major platforms and utilizes message-passing abstraction,
> > which in many cases makes multithreaded development easier.
> >
> > I think that threading support of some sort is absolute must for TA,
> because
> > it seems impossible to implement REPL or debugger without it.
> >
> > --
> > e.v.e
> >
> > On Sun, Feb 22, 2009 at 8:10 AM, mitchell <mforal.n....at.gmail.com> wrote:
> >
> > > Benjamin,
> >
> > > >Question to
> > > >Mitchell: Do you plan to add multithreading support in future?
> >
> > > I do not, simply because I haven't the slightest clue how to. I know
> > > Lua doesn't use multi-threading because it is not cross-platform and
> > > does not always behave as expected. I'm inclined to believe the same.
> >
> > > > It is up to Mitchell though to decide if this is
> > > > going to make it into textadept, cause I would not even know where to
> > > > start :) I hope he does!
> >
> > > If I did I would have no problems adding this. Unfortunately I do not
> > > know at this time.
> >
> > > Earlier I was thinking it could be done through WinAPI's SendMessageA,
> > > but I don't know how. (MSDN is a monster and I am no Windows
> > > programmer.) Ideally we would use LuaSocket, but the blocking is a
> > > problem and I know of no way around it.
> >
> > > -Mitchell;
> >
>
Received on Sun 22 Feb 2009 - 06:37:57 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:30 EST