473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

General design question relating to FSM.

Hi
I am looking for any articles anyone may know of on developing a finite
state machine in a gui application?
Basically what I have is a fairly complex gui which needs to go through
several (3 - 7?) states. Complex algorithms are running as their own
separate code blocks operating on class-level data structures, the
completion of the processing of one set of data takes the application from
one 'state' to another. Once the last operation is complete, some user
activity will probably have occurred on the user interface that makes it
'dirty' and means the first operation has to start again, to cycle the
transition of repopulating the data structures to update them.
I've decided to go down the multithreading road, because the operations take
too long (a few whole seconds) for them to execute in the primary thread of
the user interface as they block it up, but there probably IS time for them
all to run in time to 'keep up' with the user entering data as they cannot
enter a lot of data incessantly fast all the time (or probably won't) - as
the time they have to lock some actual elements on the interface is
negligible compared to the total time they will take to run.
What's more, there are some cases which will be identified where the first
process can start again before the last one of the previous cycle has
completely finished, enabling a multithreading scenario to take advantage of
this.
What's the best way of accomplishing this? I'm trying to work on a suitable
class structure.
Nov 16 '05 #1
2 1979
"Beeeeeves" <1234512345789123456789> wrote in message news:uJ**************@TK2MSFTNGP09.phx.gbl...
I've decided to go down the multithreading road, because the operations take
too long (a few whole seconds)


The simplest approach is to have one GUI thread (the main thread)
and one worker thread (background, non-GUI). The worker thread
will own the FSM. Arrange user actions on the GUI to cause the GUI
thread to post messages to the worker thread which will act on them when
finished with any preexisting work.

Nov 16 '05 #2
Beeeeeves wrote:
Hi
I am looking for any articles anyone may know of on developing a finite
state machine in a gui application?


You could take a look at the fsm library in the boost sandbox.
Documentation index is

http://cvs.sourceforge.net/viewcvs.p...doc/index.html

and a tutorial at

http://cvs.sourceforge.net/viewcvs.p.../tutorial.html

The document and code are in

http://cvs.sourceforge.net/viewcvs.p...dbox/libs/fsm/
http://cvs.sourceforge.net/viewcvs.p...box/boost/fsm/

There is quite a lot of discussion going on about this library at the
moment on the boost libs. I haven't been able to try it myself as it
doesn't work with bcc32 which is my current compiler, but I am
interested in it because we do implement a lot of state machines here.
You could get more help with it from the boost newsgroups if interested.

Cheers

Russell
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Chris | last post by:
Having been traumatised many years ago when using MFC/C++ to develop front-end code, I've religiously avoided GUI work since and stuck to back-end / server-side projects. So I'm a bit of a novice...
0
by: JKJ | last post by:
I'm not an OOP guru, but I would say ". . .not necessarily" What if the base class and derived classes are internal? Then the base class has to be within the same assembly to be inherited from. ...
3
by: reageer | last post by:
Hi all, I have a design question: I have a bunch of users (name, address, zip, etc.). They are assigned a card with a specific id. The only thing unique is this card id, or probably the...
23
by: JohnH | last post by:
I'm just recently come to work for an auto brokerage firm. My position involves performing mysterious rites, rituals and magick in order to get information out of their access database. This is...
3
by: vicky | last post by:
Hi All, Can u please suggest me some books for relational database design or database modelling(Knowledgeable yet simple) i.e. from which we could learn database relationships(one to many,many to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.