On Sep 14, 2016, at 4:35 PM, Cannon Smith wrote:

> Yep, for sure. I’d love to hear more about this aspect from 4D itself. There 
> is lots of information about messaging between processes, but not much on 
> this part yet.

Here’s my perspective on new 4D features. They are great and they can be 
useful. Can be useful to you. May be useful to you. But maybe not.

Just because 4D adds a new feature to 4D does not mean all developers should 
and/or need to use that new feature. New features are a new tool you may find 
useful. But you may find for your particular application you have no need for 
new feature. 

4D commands and features are like tools in your toolbox. 

Example: Say you are a carpenter and you build typical wood frame houses. 
Someone releases a MIG welder that uses a new technology to automatically 
select the proper type of shielding gas and mixture. You don’t have to choose 
argon, oxygen, helium, carbon dioxide or the mixture.  This is a great feature… 
if you are a welder. But if you work 99.9% of the time with wood, you’ll find 
it very hard to find a use for this new MIG welder. 

Here is a 4D example: v3 and multiple processes and multiple windows. Fantastic 
4D feature I use all the time in almost all my 4D projects, except for one. I 
wanted to update that app to have multiple windows. I thought it would be so 
much more useful to the client. 

So I did a little work and made a demo with this app of how it could work with 
multiple windows and showed it to the client hoping to get approval to do the 
upgrade work on the app. I just knew they were going to love it.

They hated it! I was shocked. They complained this made things too complicated. 
They liked only having one window open at a time. They didn’t want to have all 
this “power”. They wanted to do only one  thing at a time. They had no need or 
desire to have several windows open at once to do comparison of information or 
any of the other reasons I could come up with. So this great feature of 
multiple windows open at once in 4D was a feature this client did not want any 
part of. 

I’m going to continue to evaluate the new worker processes and preemptive 
features in v16. Right now I don’t have any existing problems or situations 
where I can immediately see it would be valuable. Maybe there will be in the 
future. Maybe not. 

I’m glad I will have this new tool in my toolbox so that if I do run into a 
situation where I need it, I can use it. 

So what would be a good use or a “need” for worker processes? From what I 
understand so far, the primary value of worker processes is the ability speed 
of a time consuming process by breaking it into pieces and spreading the load 
across multiple processors/cores. 

Say you have a super complex query that currently takes 10 seconds to run. 
You’d like it to run in 2 seconds. You figure out a way to break the query into 
5 parts. Each part runs in 2 seconds and you can combine the results of all 5 
parts easily. 

Now having 5 worker processes that are pre-emptive, can all run simultaneously 
and can use all the cores in your CPU is exactly the tool you need. In a short 
time you can improved the speed of this operation by a factor of 5. 

Before we had a tool like this you would have probably tried to do some kind of 
caching of query results or hashing or some other scheme to speed up that slow 
query. Maybe a lot more work. More tables, updating data in triggers and 
testing, testing, testing. Using worker processes avoids all this. You just use 
brute force and the full power of your computer to get the job done faster. 

I’m not sure there is going to be a lot of value in trying to use worker 
processes to do all the processing and let the UI process be stupid and just 
sit there waiting for a message from a worker that he’s got the work done that 
you need unless your UI is currently sluggish due to excessive processing going 
on. Is that the problem you are trying to resolve using worker processes?

Or do you want to use worker processes just for the sake of using them and the 
pure enjoyment of doing it. That can also be a valid reason. :)

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
********************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to