9 Replies Latest reply on Jun 27, 2017 9:54 AM by wimdecorte

    Multi-Threading FileMaker?

    gofmp15

      Back in the dark ages Apple computer joined the club and began offering Multi_finder, multi-threading etc.

       

      There were raging arguments about what is multi-threading in various lists. On the Mac at that time it was timesharing rather than simultaneous actions. An action proceeded for a few tics and then another was given some time. The computer was fast enough that the pauses weren't noticed.

       

      I used 4D before I converted exclusively to FileMaker in order to become sane again and enjoy the much restricted and easier to use environment. However, 4D was 'multi-tasking'. For instance, I wrote a short script that would open a new window and begin add one to a field and refresh window in a loop. I performed this script 24 times so that there were 24 open windows and 24 counters I could watch change their values.

       

      I can't do this in FileMaker, FileMaker is 'single threaded'. I'd have to pause a script to run another.

       

      Apple is touting an 18 Core iMac soon to be delivered. FileMaker Pro won't be using any of those to do multi-tasking as I described it above.

       

      16 delivers a much improved method of opening new windows and assigning layouts, etc. But if I have 12 windows open, only one is doing something unless there is someone to use the pause function and passing a script around.

       

      Acknowleding being able to run a script on server, wouldn't it be nice if FIleMaker Pro could start a script that opens a new window and updates all of our accounts for the EOM billing and after an account is updated that account id would be passed as a parameter to another script that printed the statement while the billing update continued. OK, one script could do that.

       

      But what if while I am watching that happen in Window A  I could update my price list in window b using script b while reviewing  estimates and job orders using a script in window c?

       

      I created a rather trying script to allow the CEO to watch the current sales over the phone in real time but that prevented him from using an of the other FileMaker features.

       

      Multi-Tasking Now!

        • 1. Re: Multi-Threading FileMaker?
          planteg

          Hi,

           

          in fact, FileMaker uses multiple threads, but that's not under the developer control. Remember, in 15 when you have more than a portal on a Layout, each portal is refreshed in it's own thread.

           

          Multi-threading is not an easy concept to the common FileMaker developer, unless you're a professional programmer. Multi-threading needs threading synchronization, inter-threading communication, thread-safe code, etc.

           

          Maybe FMI or others (new scripts steps from plugins) will find a way to make multi-threading simple to use.

          • 2. Re: Multi-Threading FileMaker?
            gofmp15

            Yes, I am aware of that.

             

            Let's simplify my question to starting 4 unique scripts with each running parallel in time with the others. (This doesn't happen but we think it does).

             

            Each script would open its own layout and perform its own unique tasks.

             

            Currently we can have many open windows in fmp but only one is actively running a script. The others are paused and doing nothing. It's like having 6 employees sitting at a computer but only one is working.

            • 3. Re: Multi-Threading FileMaker?
              siplus

              Filemaker's atom is a single field in a single record in a single table. You can unleash the powa of 100 threads upon that, but only one of them will gain full access and make that isolated entity happy, while the other 99 threads watch and nod "lucky guy". And there's no way around that.

               

              Some call it "record locking".

              • 4. Re: Multi-Threading FileMaker?
                monkeybreadsoftware

                On the server it runs parallel already.

                 

                But of course parallelism would only work on desktop with background things as they need their own session with current layout and current record which is not shown in GUI.

                • 5. Re: Multi-Threading FileMaker?
                  gofmp15

                  I scripted around locked records returning to them later.

                   

                  loop

                  find not updated records

                  exit loop if found count = 0

                  go to record first

                    Loop

                      if record is not locked

                        do stuff

                     end if

                    go to record next exit after last

                    end loop

                  go to record next exit after last

                  end loop

                   

                  that works with record locking although it needs a few extra lines.

                   

                  Serious transactions require more thought inside the do stuff statement.

                  • 6. Re: Multi-Threading FileMaker?
                    gofmp15

                    My point is that other dbs have 'multi-threading' and one can start unique scripts running at the same time but FileMaker Pro can only run one script one step at a time.

                    • 7. Re: Multi-Threading FileMaker?
                      wimdecorte

                      Yep, but that's not multi-threading so using that term is going to cause nothing but confusion.

                      • 8. Re: Multi-Threading FileMaker?
                        gofmp15

                        I have in a number of posts admitted to the problem of using the terms multi-threading and multi-tasking and how people argue about their meaning.

                         

                        My example shows how FileMaker is single/whateveryouwanttocallit and cannot run multiple scripts at the same time (relatively speaking since time is only NOW).

                         

                        I cannot set in motion multiple scripts that run without interference. One script at a time. Others must be halted or paused to perform a new script.

                        • 9. Re: Multi-Threading FileMaker?
                          wimdecorte

                          Sure; but I don't quite get the point of your posts.  The fact that FM can't run multiple scripts at the same time in one client is a fact.  Nobody comes even close to debating that.  It's been like that since forever.

                          You state that this functionality is available in other platforms: great.

                           

                          So if you want it in FM; start a product suggestion( Product Ideas  ) , outline use cases why you would like this so that other people can vote on it.

                           

                          I have the sense that you're stuck in the definition of it.  In multiple posts at that, but very little seems to go somewhere and discuss things that you'd love to do with and let others give feedback on how they solve the issue.

                          I suggested PSoS as a way to do multiple things at the time and your only response is 'that's not truly doing multiple things at the time on the same client'.  Clearly it isn't, but does it solve the problem at hand?  Perhaps; but you haven't defined a specific problem beyond 'it can't do two things at the same time'.