Re: Single instance module and multithreading

From: helgoboss <benjamin.k....at.gmail.com>
Date: Sun, 22 Feb 2009 04:29:43 -0800 (PST)

Hi Vyacheslav,

> 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.

I thought about this, too. Like in Java the Swing AWT event thread. Do
you have any idea how this is usually implemented? Thinking loud:
There must be something like an event queue that contains pieces of
code to be executed in sequence by the main thread. And the secondary
threads do nothing else than appending pieces of code to this queue.

Nevertheless, the event queue still has to be accessed in some way
from the secondary threads. How would you accomplish this with the
approach taken by LuaLanes? Anyway, the event queue approach would
release the burden of making everything thread safe, that sounds good.

> 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.

Concerning the use cases, until now we have:
* Listening on a socket in background (for remote controlling and
single instance feature)
* Running an external process and printing output continuously into a
Textadept buffer

Regards
Received on Sun 22 Feb 2009 - 07:29:43 EST

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