Re: Multithreaded application freezing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Den 2015-02-03 16:23, Emmanuele Bassi skrev:
> hi;
> 
> On 2 February 2015 at 22:07, G Hasse <gorhas@xxxxxxxxxx> wrote:
>> Den 2015-02-02 22:57, Gulshan Singh skrev:
>>
>> I strongly advice designing an application in this way.  Every window in an
>> application should be a separate process. Between processes you should
>> find a good protocol. This protocol should be transported over some message
>> buss. (example: www.spread.org)
> 
> there are loads of issues with a design like that.
> 
> you're going to overengineer your application, and then have issues
> whenever you have to context switch between processes because you
> moved from a window to another one inside your own application.

Noop! Absolutly not! This is basic and good design. You should *separate* your
data and the program that manipulate the data. The design pattern is called
model-view-control and is well understood today. You should have a good *protocol* to
manipulate your data. The userinterface is just a way to fire of a specific "command".
 
> you'll have to ensure all your shared data structures are copied
> correctly across process boundaries, and you'll have to have proper
> bookkeeping to ensure processes do not end up using old data.

NOOP! The data should *not* be copied! You should have your data *separate* from
the manipulating program. Ever heard of the concept of a database? (The protocol here
is SQL).

> you won't be able to fork() and build your UI in a child: that's not
> how X11 (or any other windowing system, really) works. you'll need to
> spawn a new child process from a server.

Absolutly no problem. You have a missconception of what a "server is". Any
program that listen on sockets is a server. Every GUI-program is a server. It
listen on mouse-move, key-bord-press and it is easy to have it also listen
on event on sockets.

http://youtu.be/Vrz8ilwnBJY

In this application the datastore is xml (the application is using librsvg for rendering).
So I can manipulat the picture with simple xml "update" commands. And the library can
rerender the data. 


> it's not that you cannot do it. it's that you're overcomplicating any
> design in a way that rapidly explodes the maintainership overhead of
> your project.

It is exaclty the other way around! Design a good datastore and a manipulating
protocol and you can write any kind of GUI or command line tool to manipulating
it.

> ciao,
>  Emmanuele.
> 

-- 
Göran Hasse
Raditex Control AB
OrgNr: 556611-8773
email: gorhas@xxxxxxxxxx
tel: 019-450105
mob: 070-5530148
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list





[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux