User Tag List

Results 1 to 4 of 4

Thread: Yet Another Allegro Race Condition

  1. #1
    ZC Contirbutor ZC Developer ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,030
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,586
    Level
    19
    vBActivity - Bars
    Lv. Percent
    17.74%
    Daily Activity
    0%
    Weekly Activity
    51.18%
    Monthly Activity
    15.43%

    Yet Another Allegro Race Condition

    This one is with scrollbars and scroll arrows in ZQ and ZC listers.

    When there are multiple allegro threads, whatever variable that allegro uses to track scroll speed is losing its mind. This is the cause of support ticket 113:
    https://github.com/ArmageddonGames/Z...sic/issues/113

    While I had both Grabber, and FontEd open, the listers in ZQuest instantly jumped from the top of the list, to the bottom, or the reverse, when using the arrow buttons.


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

  2. #2
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    34
    Posts
    3,340
    Mentioned
    164 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,034
    Level
    24
    vBActivity - Bars
    Lv. Percent
    3.44%
    Daily Activity
    0%
    Weekly Activity
    19.69%
    Monthly Activity
    11.76%
    That seems exceedingly unlikely... Is this consistently reproducible? The list scroll variable isn't used by multiple threads, and there's no reason it should be visible to other processes. If it were being corrupted by another process somehow, I'd expect it to affect a lot of other things, and the program would probably crash before you observed any other effects.
    Have you tried watching the variable in a debugger? Or just adding some traces to _handle_jwin_scrollable_scroll_click? The click handling uses a while(gui_mouse_b()) loop (jwin.cpp line 1852). Maybe that's not timed properly for some reason. If it's running as fast as it can, it'll register a lot of clicks at once, which would make it jump like that.


    Hard to say if it's related, but I see this line in _handle_jwin_listbox_click:
    Code:
    rest_callback(MID(10, text_height(font)*16-d->h, 100), idle_cb);
    That first argument to rest_callback is the wait time in milliseconds. Why would the list height and some font size have anything to do with that? That's not even the list font; it's a global one used for other things. That has to be a mistake, but I don't know what the intention might have been.
    [téknolŕiz]

    ffcscript.zh 1.1.1 - Updated 2014-08-19
    ghost.zh 2.8.2 - Updated 2017-09-10
    tango.zh 1.3.0 - Updated 2017-09-10

  3. #3
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    68 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    10,793
    Level
    30
    vBActivity - Bars
    Lv. Percent
    80.24%
    Daily Activity
    0%
    Weekly Activity
    3.94%
    Monthly Activity
    4.41%
    I cannot reproduce the issue using multiple ZQuest windows or ZQuest+Zelda. Echoing Saffith's question: does this always happen for you when you have two Allegro applications running simultaneously?

  4. #4
    ZC Contirbutor ZC Developer ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,030
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,586
    Level
    19
    vBActivity - Bars
    Lv. Percent
    17.74%
    Daily Activity
    0%
    Weekly Activity
    51.18%
    Monthly Activity
    15.43%
    Quote Originally Posted by DarkDragon View Post
    I cannot reproduce the issue using multiple ZQuest windows or ZQuest+Zelda. Echoing Saffith's question: does this always happen for you when you have two Allegro applications running simultaneously?


    I will run some tests, but this did not have the highest priority. It may only surface when running older allegro programmes (e.g. under ag 4.2, 4.1, 4.0).


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social