Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. I need help!

I need help!

Scheduled Pinned Locked Moved Help and Support
10 Posts 3 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • iTap DevelopmentI Offline
    iTap DevelopmentI Offline
    iTap Development
    wrote on last edited by
    #1

    If I have a setup where two objects are getting an attribute and adding 1 to it(and then setting it) is there any possibility that one might get the attribute while the other one is adding, and effectively increase the attribute by 1 instead of 2? Assuming that they may not always trigger at the same time.
    If that makes any sense.

    D Aidan_FireA 2 Replies Last reply
    0
    • iTap DevelopmentI iTap Development

      If I have a setup where two objects are getting an attribute and adding 1 to it(and then setting it) is there any possibility that one might get the attribute while the other one is adding, and effectively increase the attribute by 1 instead of 2? Assuming that they may not always trigger at the same time.
      If that makes any sense.

      D Offline
      D Offline
      Deeeds
      wrote on last edited by
      #2

      @iTap-Development

      I'm not asking for a project. This is beyond my current understanding of how hyperPad operates.

      But you've had 45 minutes from the original post to add a project example. And yet haven't done it.

      Some of the answers to your questions about why I don't upload projects likely have some overlap with your existing reasons in this scenario.

      As to your problem:

      Concurrency and data state is an enormously difficult problem to solve in computing, despite having first been solved in the 1960's - that solve was thrown away and left to wither and die. The problems you see with Apple's roll out of iCloud are partly related.

      Let's examine:

      Object ABC and XYZ are as you say, going to both do an operation on the same data, and don't expect anyone else to do anything during that time, and then update that data.

      If ABC grabs 1 and adds to it, and whilst he's doing this Object XYZ grabs it and begins performing the same operation, then yes... what can happen is this:

      ABC finishes while XYZ is adding, and ABC updates the variable. If XYZ doesn't check to make sure that the variable hasn't changed whilst performing his operation, he could simply overwrite the variable with the exact same value...

      One solution, when XYZ has finished adding, he can check to see if the value changed, and if it did, re-perform the operation with the new value.

      But what if the source value changes AGAIN whilst he's doing this new addition?

      And on and on it goes.

      So the traditional solution is to have a flag that makes it obvious that the data in a source has been "checked out" and that someone is currently operating on that value and intends to update it when they're done. And this causes a backlog, cause now XYZ has to sit and wait for the value to be checked back in so he can have his turn on the value.

      Another solution is to send the operation to the object and say "When you get a moment, can you do this?"

      iTap DevelopmentI 1 Reply Last reply
      0
      • D Deeeds

        @iTap-Development

        I'm not asking for a project. This is beyond my current understanding of how hyperPad operates.

        But you've had 45 minutes from the original post to add a project example. And yet haven't done it.

        Some of the answers to your questions about why I don't upload projects likely have some overlap with your existing reasons in this scenario.

        As to your problem:

        Concurrency and data state is an enormously difficult problem to solve in computing, despite having first been solved in the 1960's - that solve was thrown away and left to wither and die. The problems you see with Apple's roll out of iCloud are partly related.

        Let's examine:

        Object ABC and XYZ are as you say, going to both do an operation on the same data, and don't expect anyone else to do anything during that time, and then update that data.

        If ABC grabs 1 and adds to it, and whilst he's doing this Object XYZ grabs it and begins performing the same operation, then yes... what can happen is this:

        ABC finishes while XYZ is adding, and ABC updates the variable. If XYZ doesn't check to make sure that the variable hasn't changed whilst performing his operation, he could simply overwrite the variable with the exact same value...

        One solution, when XYZ has finished adding, he can check to see if the value changed, and if it did, re-perform the operation with the new value.

        But what if the source value changes AGAIN whilst he's doing this new addition?

        And on and on it goes.

        So the traditional solution is to have a flag that makes it obvious that the data in a source has been "checked out" and that someone is currently operating on that value and intends to update it when they're done. And this causes a backlog, cause now XYZ has to sit and wait for the value to be checked back in so he can have his turn on the value.

        Another solution is to send the operation to the object and say "When you get a moment, can you do this?"

        iTap DevelopmentI Offline
        iTap DevelopmentI Offline
        iTap Development
        wrote on last edited by
        #3

        @Deeeds the most a project would do is help explain myself. Also, I’m not sure how I would set up a project that could even demonstrate the question, since I don’t know if it even would happen.
        In your case, the for each wasn’t doing what you expected. That was something that could be diagnosed by another user.
        This question was more directed towards the Hyperpad team, since they might known how that situation with the attributes would be handled.

        D 1 Reply Last reply
        0
        • iTap DevelopmentI iTap Development

          @Deeeds the most a project would do is help explain myself. Also, I’m not sure how I would set up a project that could even demonstrate the question, since I don’t know if it even would happen.
          In your case, the for each wasn’t doing what you expected. That was something that could be diagnosed by another user.
          This question was more directed towards the Hyperpad team, since they might known how that situation with the attributes would be handled.

          D Offline
          D Offline
          Deeeds
          wrote on last edited by
          #4

          @iTap-Development So you didn't read beyond my teasing?

          iTap DevelopmentI 1 Reply Last reply
          0
          • D Deeeds

            @iTap-Development So you didn't read beyond my teasing?

            iTap DevelopmentI Offline
            iTap DevelopmentI Offline
            iTap Development
            wrote on last edited by
            #5

            @Deeeds yes, I did😁
            That’s basically what my conclusion was. But it helpful info! Thanks

            1 Reply Last reply
            0
            • iTap DevelopmentI iTap Development

              If I have a setup where two objects are getting an attribute and adding 1 to it(and then setting it) is there any possibility that one might get the attribute while the other one is adding, and effectively increase the attribute by 1 instead of 2? Assuming that they may not always trigger at the same time.
              If that makes any sense.

              Aidan_FireA Offline
              Aidan_FireA Offline
              Aidan_Fire
              wrote on last edited by
              #6

              @iTap-Development I think that if they both attempt to do it at the same time, it’ll actually add by 2, but I’m not 100% sure. Maybe you should test it, make an object that adds a to some attribute, then duplicate it a few times, and see if the attribute ends up being added by the amount of duplicate objects.

              iTap DevelopmentI 1 Reply Last reply
              0
              • Aidan_FireA Aidan_Fire

                @iTap-Development I think that if they both attempt to do it at the same time, it’ll actually add by 2, but I’m not 100% sure. Maybe you should test it, make an object that adds a to some attribute, then duplicate it a few times, and see if the attribute ends up being added by the amount of duplicate objects.

                iTap DevelopmentI Offline
                iTap DevelopmentI Offline
                iTap Development
                wrote on last edited by iTap Development
                #7

                @Aidan-Oxley I could try, it but I can’t really be sure if they are triggering at the right moment to cause a problem. Right?
                šŸ¤·ā€ā™‚ļø

                Aidan_FireA 2 Replies Last reply
                0
                • iTap DevelopmentI iTap Development

                  @Aidan-Oxley I could try, it but I can’t really be sure if they are triggering at the right moment to cause a problem. Right?
                  šŸ¤·ā€ā™‚ļø

                  Aidan_FireA Offline
                  Aidan_FireA Offline
                  Aidan_Fire
                  wrote on last edited by
                  #8

                  @iTap-Development I’ll try it. It’s pretty simple though, I’m just gonna make a heap of objects wait like 5 seconds from the start of the project being run, then they are all gonna try to add 1 to some attribute, then I’m gonna see what the attribute turns out to be.

                  1 Reply Last reply
                  0
                  • iTap DevelopmentI iTap Development

                    @Aidan-Oxley I could try, it but I can’t really be sure if they are triggering at the right moment to cause a problem. Right?
                    šŸ¤·ā€ā™‚ļø

                    Aidan_FireA Offline
                    Aidan_FireA Offline
                    Aidan_Fire
                    wrote on last edited by
                    #9

                    @iTap-Development This is awesome. No matter how many objects attempting to add to the attribute at the same time, they all managed to do it without interrupting each other. I added 30 objects, all adding the the attribute at the same time, the attribute went up by 30 every time I triggered it (it was like a loop, I couldn’t see any numbers display between 0 and 30).

                    iTap DevelopmentI 1 Reply Last reply
                    1
                    • Aidan_FireA Aidan_Fire

                      @iTap-Development This is awesome. No matter how many objects attempting to add to the attribute at the same time, they all managed to do it without interrupting each other. I added 30 objects, all adding the the attribute at the same time, the attribute went up by 30 every time I triggered it (it was like a loop, I couldn’t see any numbers display between 0 and 30).

                      iTap DevelopmentI Offline
                      iTap DevelopmentI Offline
                      iTap Development
                      wrote on last edited by
                      #10

                      @Aidan-Oxley cool!

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better šŸ’—

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Search