> On Aug 25, 2018, at 9:10 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > As I see it, we'll need to call a worker, which calls the worker that > assigns the record number. > The first worker has to wait until the second one has created the new > number. > Then the original method, that called the first worker, must wait until the > first worker gets the new number. It seems that this won't be much better > than the old method. > > Am I completely barking up the wrong tree? Is this not an appropriate use > for workers? Or have I misunderstood something?
It would have been really nice if CALL WORKER was implemented like EXECUTE METHOD and could return a value. You can do this on your own, but it is quite a bit of work to do it in a general way. For your application, all you need is a shared object (no worker needed). Only one process at a time will be able to modify the counter. Some startup method could initialize the counter to the starting value. C_LONGINT($0) Use (Storage.myCounter) Storage.myCounter.value:= Storage.myCounter.value+1 $0:= Storage.myCounter.value End use John DeSoi, Ph.D. ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************