Abstract: A method for updating display and event processing in multi-thread graphical user interface application is disclosed. In this method, the update is classified into complete refresh or partial refresh. In the case of complete refresh, the draw function of all the visible widgets is executed and in the case of partial refresh, the widgets that are updated are stored in a primary and secondary list and only the draw function of the updated widgets is executed. Further, the events are classified as complete refresh events or partial refresh events. As the event thread processes the event data, it checks the event classification type. In the case of partial refresh event, it will add the widgets that get affected by the event in primary/secondary list for display updates. In the case of complete refresh events, the event thread resets the primary/secondary lists and sets a complete refresh flag high. Refer Fig. 1
TECHNICAL FIELD
[0001] The present invention relates to a method for updating the display and event processing in a multithreaded application executing on a single board computer. It further relates to a method for updating the graphical user interface widgets in a multithreaded application.
BACKGROUND
In control systems, the applications execute on a real time environment with priority based pre-emptive scheduling for the CPU time-slice. In the present scenarios such applications also require rich graphics interfaces and displays. Such systems execute on a single board computer and have several processes/threads which execute on different level of priorities with the display thread having the lowest priority. Here, the display and the event threads have to work in close synchronisation to have an efficient event processing and display updates. The displays are comprised of various widgets which has a draw method associated with it. A widget is rendered by executing the draw method associated with it.
One of the traditional methods involved a method for monitoring a computer user's usage pattern of the GUI element and updating a user-usage parameter. Here, the graphical rendering of the GUI element is further updated based on the user-usage parameter, thereby updating the appearance of the GUI element displayed on the GUI client's display to reflect the computer user's usage pattern of the GUI element. This method fails to provide a method for effectively updating the display. One more conventional method discloses a collection of objects presented in a user interface environment, such as a graphical user interface (GUI). Further, a collection view i.e. list objects is refreshed only once all of the selected objects have been processed. In addition, the view is refreshed only if an action performed on any of the selected objects affects the view. This method does not use a localised draw or a complete draw update mechanisms for
updating the GUI. Hence these methods fail to provide a method to efficiently update a display.
[0004] Hence, there is a need of an invention which solves the above
defined problems and provides an effective method and system for updating the display and event processing in a multithreaded application.
SUMMARY
[0005] This summary is provided to introduce concepts related to a
method for updating the display and event processing in a multithreaded application executing on a single board computer. This summary is neither intended to identify essential features of the present invention nor is it intended for use in determining or limiting the scope of the present invention.
[0006] One of the various embodiments herein may include one or more
methods for updating the display and event processing in a multithreaded application executing on a single board computer. It further includes a method for updating the graphical user interface widgets in a multithreaded application. In one of the embodiments, the method is used to update the graphical user interface display in a multi-thread graphical user interface application. This method further involves classification of plurality of events into a complete refresh event or a partial or localised refresh events. It further involves maintaining a list that contains the widget pointers of the graphical user interface widgets that are updated due to the partial or localised refresh events. Further, the method includes re-setting the list that contains the widget pointers of the graphical user interface widgets, on generation of the complete refresh event.
[0007] In another implementation, the method further consists that as
event is generated it is classified as complete refresh event or partial refresh event by the event generator method. Further, the event details including the plurality of widgets that are updated due to the plurality of events are encapsulated and sent on the inter-process communication (IPC) mechanism to the event thread. Further, the widgets pointers are added to the primary or the secondary list which are
protected by flags to avoid race conditions as the lists are used across multithreads. These widget pointers are added to the list after checking for duplicate entries. Moreover, the primary and the secondary lists are re-set on receiving complete refresh events as the draw function of all the plurality of widgets will be executed as part of the complete refresh events which includes the widgets present in the primary and secondary lists.
BRIEF DESCRIPTION OF ACCOMPANYING DRAWINGS
[0008] The detailed description is described with reference to the
accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The same numbers are used throughout the drawings to reference features.
[0009] Fig. 1 illustrates a block diagram of multithread graphical user
interface application depicting threads, inter-process communication mechanisms, operating system and hardware, according to an exemplary implementation of the presently claimed subject matter.
[0010] Fig. 2 illustrates the initialization of multithread graphical user
interface application, according to an exemplary implementation of the presently claimed subject matter.
[0011] Fig. 3 illustrates a flow chart explaining the display thread
functionalities, according to an exemplary implementation of the presently claimed subject matter.
[0012] Fig. 4 illustrates a flow chart explaining the event processing
thread functionalities, according to an exemplary implementation of the presently claimed subject matter.
[0013] Fig. 5 illustrates a flow chart explaining the timer thread
functionalities with respect to the display updates, according to an exemplary implementation of the presently claimed subject matter.
[0014] Fig. 6 illustrates a flow chart explaining about input thread
functionalities, according to an exemplary implementation of the presently claimed subject matter.
[0015] It should be appreciated by those skilled in the art that any block
diagrams herein represent conceptual views of illustrative methods embodying the principles of the present disclosure. Similarly, it will be appreciated that any flow charts, flow diagrams, and the like represent various processes which may be substantially represented in computer readable medium and so executed by a computer or processor, whether or not such computer or processor is explicitly shown.
DETAILED DESCRIPTION
[0016] The various embodiments of the present disclosure provide a
method for updating the display and event processing in a multithreaded application executing on a single board computer. It further provides a method for updating the graphical user interface widgets in a multithreaded application.
[0017] In the following description, for purpose of explanation, specific
details are set forth in order to provide an understanding of the present claimed subject matter. It will be apparent, however, to one skilled in the art that the present claimed subject matter may be practiced without these details. One skilled in the art will recognize that embodiments of the present claimed subject matter, some of which are described below, may be incorporated into a number of systems.
[0018] However, the systems and methods are not limited to the specific
embodiments described herein. Further, structures and devices shown in the figures are illustrative of exemplary embodiments of the presently claimed subject matter and are meant to avoid obscuring of the presently claimed subject matter.
[0019] Furthermore, connections between components and/or modules
within the figures are not intended to be limited to direct connections. Rather,
these components and modules may be modified, re-formatted or otherwise changed by intermediary components and modules.
[0020] One of the various embodiments herein may include one or more
methods for updating the display and event processing in a multithreaded application executing on a single board computer. It further includes a method for updating the graphical user interface widgets in a multithreaded application. In one of the embodiments, the method is used to update the graphical user interface display in a multi-thread graphical user interface application. This method further involves classification of plurality of events into a complete refresh event or a partial or localised refresh events. It further involves maintaining a list that contains the widget pointers of the graphical user interface widgets that are updated due to the partial or localised refresh events. Further, the method includes re-setting the list that contains the widget pointers of the graphical user interface widgets, on generation of the complete refresh event.
[0021] In another embodiment, the method further involves that as event is
generated it is classified as complete refresh event or partial refresh event by the event generator method. Further, the event details including the plurality of widgets that are updated due to the plurality of events are encapsulated and sent on the inter-process communication (IPC) mechanism to the event thread. Further, the widgets pointers are added to the primary or the secondary list which are protected by flags to avoid race conditions as the lists are used across multithreads. These widget pointers are added to the list after checking for duplicate entries. Moreover, the primary and the secondary lists are re-set on receiving complete refresh events as the draw function of all the plurality of widgets will be executed as part of the complete refresh events which includes the widgets present in the primary and secondary lists.
[0022] It should be noted that the description merely illustrates the
principles of the present invention. It will thus be appreciated that those skilled in the art will be able to devise various arrangements that, although not explicitly described herein, embody the principles of the present invention. Furthermore, all
examples recited herein are principally intended expressly to be only for explanatory purposes to help the reader in understanding the principles of the invention and the concepts contributed by the inventor to furthering the art and are to be construed as being without limitation to such specifically recited examples and conditions. Moreover, all statements herein reciting principles, aspects, and embodiments of the invention, as well as specific examples thereof, are intended to encompass equivalents thereof.
[0023] Fig. 1 illustrates a block diagram 100 of multithread graphical user
interface application depicting threads, inter-process communication mechanisms, operating system and hardware, according to an exemplary implementation of the present claimed subject matter. In the present implementation, the single board computer 110 is abstracted into hardware 102, operating system 104, and application layer 108. The inter-process communication (IPC) mechanism 106 is a part of the operating system component. Further, the application layer has n number of threads 120 including a timer thread 112, an input thread 114, a display thread 116 and an event thread 118.
[0024] Furthermore, the display thread 116 is configured to create a
plurality of graphical user interface widgets and to render the same on the display. The input thread 114 is configured to read the input event and to transfer said event to the event thread 118. Further, the event thread is configured to identify to which widget the event is intended for and based on that processes the plurality of events. It is further configured to check the classification of the type of event and in the case of partial refresh event, it adds the widget pointer to a widget list. And in the case of complete refresh event, a flag is updated by the event thread 118 and the widget list is reset as the plurality of widgets will be redrawn. This widget list is comprised of a primary and secondary list to ensure synchronisation as the lists are accessed across two threads. Further, the timer thread 112 is configured to periodically trigger the event of the display thread 116. Further, the display thread 116 is configured to check the status of the flag, if it is set, the display thread 116 is configured to render the draw function of all the widgets and if the flag is not
set then the display thread 116 is configured to read the widget list updated by the event thread and renders the draw function of the plurality of widgets present in the list.
[0025] Fig. 2 illustrates the initialization of multithread graphical user
interface application 200, according to an exemplary implementation of the present claimed subject matter. In the present implementation, the method involves a step 202 for creating and initialising an inter-process communication (IPC) mechanism of the display queue, event queue and other related queues. Here, the display queue is the interface to the display thread 116 and the event queue is the interface to the event thread 118. Further, it consists of a step 204 for creating and initialising the timer thread 112, the input thread 114, the display thread 116, the event thread 118 and all other application threads. The method further involves a step 206 for executing the plurality of initialized threads based on the user-defined priority.
[0026] Fig 3 illustrates a flow chart 300 explaining the display thread
functionalities, according to an exemplary implementation of the present claimed subject matter. In the present implementation, the method involves step 302 in which the graphical user interface widgets are created and corresponding widget pointers of the graphical user interface widgets are stored in the database. Further, at step 304, the display thread waits on the IPC display queue. This operation of waiting is called a blocking operation. Further, the TIMER_UPDATE Data on the queue is sent from the timer thread periodically, for example once in 50 millisecond. At step 306, on receiving the TIMER_UPDATE data from the timer thread, the display thread checks the status of the COMPLETE_REDRAW_FLAG (at step 308). At step 310, if the flag is set, the display thread resets the primary widget list, the secondary widget list and the PRIMARY_LIST_BUSY_FLAG and it further calls the draw function of all the plurality of visible graphical user interface widgets. Further, at step 312, if the flag is not set, the display thread reads the data from the primary list and sets the PRIMARY_LIST_BUSY_FLAG as high and calls the draw function of the
plurality of graphical user interface widgets which are present in the primary list. Further, the display thread then resets the PRIMARY_LIST_BUSY_FLAG as low and also resets the Primary List. At step 314, the same operations are further repeated with the secondary list and then it continues to wait on the IPC display queue.
[0027] Fig 4 illustrates a flow chart 400 explaining the event processing
thread functionalities, according to an exemplary implementation of the present claimed subject matter. In the present implementation, the method involves step 402 in which the Event thread waits on IPC Event Queue for the event data. This operation of waiting is called a blocking operation. Further, on receiving the event data from the other threads on the event queue, the event type and the widget pointer are extracted. At step 404, on receiving the event data, the event thread checks for the type of the event. Further, at step 406, if the Event Type is classified as a COMPLETE_REDRAW_EVENT which is also known as a complete refresh event, then the COMPLETE_REDRAW_FLAG is set high. The primary and secondary widget list is reset. At step 408, if the Event Type is not classified as COMPLETE_REDRAW_EVENT which indicates that it is classified as localised or partial refresh event, then the COMPLETE_REDRAW_FLAG is set low. Further, at step 410, the PRIMARY_LIST_BUSY_FLAG is checked. If it is set, the widget pointer is added to the secondary list (at step 416) after checking for the duplicate entry (at step 412) else it is added to the primary list (at step 418) after checking for the duplicate entry (at step 414).Then, it continues to wait on the IPC event queue.
[0028] Fig 5 illustrates a flow chart 500 explaining the timer thread
functionalities with respect to the display updates, according to an exemplary implementation of the present claimed subject matter. In the present implementation, the method involves a step 502 in which the timer thread periodically, for example once in 50 millisecond, writes TIMER_UPDATE data to the IPC display queue and the same data is read by the display thread to update the graphical user interface display.
[0029] Fig 6 illustrates a flow chart explaining about input thread
functionalities, according to an exemplary implementation of the present claimed subject matter. In the present implementation, the method involves a step 602 in which the input thread waits on the input device for the event data. This operation of waiting is called a blocking operation. This event data is raised by the input devices such as the mouse, keyboard and the like and the other events are the display events which includes background foreground colour changes, text changes etc. It further consists of step 604 wherein on receiving the event data, the input thread writes this event data to the IPC event queue and the same data is read by the event thread for processing the events and updating the primary or the secondary lists.
[0030] The foregoing description of the invention has been set merely to
illustrate the invention and is not intended to be limiting. Since modifications of the disclosed embodiments incorporating the substance of the invention may occur to person skilled in the art, the invention should be construed to include everything within the scope of the invention.
We Claim:
1. A method for updating display in a multithread graphical user interface
application, the method comprising:
classifying, by an event thread (118), the plurality of events into a complete refresh event or a partial refresh event;
maintaining, by the event thread (118), a list containing a widget pointers of the graphical user interface widgets which are updated due to the partial refresh event;
resetting, by the event thread (118), the list containing the widget pointers based on the generation of the complete refresh event.
2. The method as claimed in claim 1, wherein the step of updating the
graphics display further comprises:
classifying, by the display thread (116), the update for the display into a complete refresh and a partial refresh;
executing, by the display thread (116), a draw function of the plurality of visible graphical user interface widgets, if the update is classified into complete refresh;
storing, by the display thread (116), the updated graphical user interface widgets in the primary list and the secondary list, and
executing, by the display thread (116), the draw function of the updated graphical user interface widgets, if the update is classified into partial refresh.
3. The method as claimed in claim 1, wherein the step of processing a
plurality of events further comprises:
determining, by the event thread (118), the classification of the plurality of events;
adding, by the event thread (118), the graphical user interface widgets that get updated by the event in the primary or the secondary list for display updates, if the event is a partial event;
resetting, by the event thread (118), the primary or the secondary lists and setting a complete refresh flag high, if the event is a complete refresh event.
4. The method as claimed in claim 1, further comprises:
triggering, by the display thread (116), the display thread periodically wherein the display thread reads the state of the complete refresh flag;
rendering, by the display thread (116), the draw function of all the visible graphical user interface widgets if the flag is high, and
reading, by the display thread (116), the primary and the secondary list and rendering the draw function of the selected graphical user interface widgets, if the flag is low.
5. The method as claimed in claim 1, wherein the step of classifying a
plurality of events into a complete refresh event or a partial refresh event
further comprises:
encapsulating, by the event thread (118), the event data including the graphical user interface widget that get updated due to the plurality of events; and
sending, by the event thread (118), the same on the inter-process communication mechanism to the event thread.
6. The method as claimed in claim 1, wherein the step of maintaining a list
containing the widget pointers of the graphical user interface widgets that are
updated due to partial (localised) refresh events further comprises:
adding, by the event thread (118), of the widget pointers to the primary or secondary list after checking for duplicate entries;
protecting, by the event thread (118), said primary or secondary lists by flags to avoid race conditions as the plurality of lists are used across multithreads.
7. The method as claimed in claim 1, wherein the step of resetting the list
containing the widget pointers based on the generation of the complete
refresh event further comprises:
executing, by the event thread (118), the draw function of all the graphical user interface widgets as part of the complete refresh events which includes the graphical user interface widgets present in the primary and secondary lists.
8. A system for updating display in a multithread graphical user interface
application, said system comprising:
an event thread (118) configured to classify a plurality of events into a complete refresh event or a partial refresh event;
the event thread (118) configured to maintain a list containing a widget pointers of the graphical user interface widgets that are updated due to the partial refresh event;
the event thread (118) configured to reset the list containing the widget pointers based on the generation of the complete refresh event.
9. The system as claimed in claim 8, wherein the update of the graphics
display further comprises:
a display thread (116) configured to classify the update for the display into a complete refresh and a partial refresh;
the display thread (116) configured to execute the draw function of the plurality of visible graphical user interface widgets, if the update is classified into complete refresh;
the display thread (116) configured to store the plurality of updated graphical user interface widgets in the primary list and the secondary list, and
the display thread (116) configured to execute the draw function of the updated graphical user interface widgets, if the update is classified into partial refresh.
10. The system as claimed in claim 8, wherein the process of a plurality of
events further comprises:
the event thread (118) configured to determine the classification of the plurality of events;
the event thread (118) configured to add the graphical user interface widgets that get updated by the event in the primary or the secondary list for display updates, if the event is a partial event;
the event thread (118) configured to reset the primary or the secondary lists and setting a complete refresh flag high, if the event is a complete refresh event.
11. The system as claimed in claim 8, further comprises:
the display thread (116) configured to trigger the display thread periodically wherein the display thread reads the state of the complete refresh flag;
the display thread (116) configured to render the draw function of all the visible graphical user interface widgets if the flag is high;
the display thread (116) configured to read the primary and the secondary list and rendering the draw function of the selected graphical user interface widgets, if the flag is low.
12. The system as claimed in claim 8, wherein the classification of a
plurality of events into a complete refresh event or a partial refresh event
further comprises:
the event thread (118) configured to encapsulate the event data including the graphical user interface widget that get updated due to the plurality of events; and
the event thread (118) configured to send the same on the inter-process communication mechanism to the event thread.
13. The system as claimed in claim 8, wherein to maintain a list containing
the widget pointers of the graphical user interface widgets that are updated
due to partial (localised) refresh events further comprises:
the event thread (118) configured to add the widget pointers to the primary or secondary list after checking for duplicate entries;
the event thread (118) configured to protect said primary or secondary lists by flags to avoid race conditions as the plurality of lists are used across multithreads.
14. The system as claimed in claim 8, wherein the reset of the list
containing the widget pointers based on the generation of the complete
refresh event further comprises:
the event thread (118) configured to execute the draw function of all the graphical user interface widgets as part of the complete refresh events which includes the graphical user interface widgets present in the primary and secondary lists.
| # | Name | Date |
|---|---|---|
| 1 | 201841036943-STATEMENT OF UNDERTAKING (FORM 3) [29-09-2018(online)].pdf | 2018-09-29 |
| 2 | 201841036943-FORM 1 [29-09-2018(online)].pdf | 2018-09-29 |
| 3 | 201841036943-FIGURE OF ABSTRACT [29-09-2018(online)].pdf | 2018-09-29 |
| 4 | 201841036943-DRAWINGS [29-09-2018(online)].pdf | 2018-09-29 |
| 5 | 201841036943-DECLARATION OF INVENTORSHIP (FORM 5) [29-09-2018(online)].pdf | 2018-09-29 |
| 6 | 201841036943-COMPLETE SPECIFICATION [29-09-2018(online)].pdf | 2018-09-29 |
| 7 | 201841036943-FORM-26 [27-12-2018(online)].pdf | 2018-12-27 |
| 8 | Correspondence by Agent_Power of Attorney_07-01-2019.pdf | 2019-01-07 |
| 9 | 201841036943-Proof of Right (MANDATORY) [27-03-2019(online)].pdf | 2019-03-27 |
| 10 | Correspondence by Agent_Form 1_01-04-2019.pdf | 2019-04-01 |
| 11 | 201841036943-FORM 18 [10-02-2021(online)].pdf | 2021-02-10 |
| 12 | 201841036943-FER.pdf | 2022-01-17 |
| 13 | 201841036943-OTHERS [15-07-2022(online)].pdf | 2022-07-15 |
| 14 | 201841036943-FER_SER_REPLY [15-07-2022(online)].pdf | 2022-07-15 |
| 15 | 201841036943-DRAWING [15-07-2022(online)].pdf | 2022-07-15 |
| 16 | 201841036943-COMPLETE SPECIFICATION [15-07-2022(online)].pdf | 2022-07-15 |
| 17 | 201841036943-CLAIMS [15-07-2022(online)].pdf | 2022-07-15 |
| 18 | 201841036943-ABSTRACT [15-07-2022(online)].pdf | 2022-07-15 |
| 19 | 201841036943-PatentCertificate06-12-2023.pdf | 2023-12-06 |
| 20 | 201841036943-IntimationOfGrant06-12-2023.pdf | 2023-12-06 |
| 21 | 201841036943-FORM-27 [13-08-2025(online)].pdf | 2025-08-13 |
| 1 | threadAE_31-10-2023.pdf |
| 2 | search_201841036943E_14-01-2022.pdf |