just a curiosity - pre emptive threads

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: just a curiosity - pre emptive threads

4D Tech mailing list
Well, the engine does handle preemptive threads completely transparently since version 11. We're talking about code that you write for your custom application.



> On Jul 12, 2018, at 10:02 AM, Paul Lovejoy via 4D_Tech <[hidden email]> wrote:
>
> Is it just me, or does anyone else expect that a database engine would handle preemptive threads, transactions and concurrence transparently?

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: just a curiosity - pre emptive threads

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Why not? It isn't supported? I just checked In Transaction in trigger is a preemptive compliant. It means, preemptive mode does expect transaction. Any hidden constraint?

Without transaction, trigger is meaningless. When a trigger invoked, mulitple tables might be updated inside the trigger. When trigger was rejected, other updated tables won't roll back except the trigger invoking table. This would cause serious
data integrity issue.

Alan Chan

4D iNug Technical <[hidden email]> writes:
>transactional data entry is kind of task you would typically want to avoid using preemptive mode.

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: just a curiosity - pre emptive threads

4D Tech mailing list
to beat a dead horse(?)...
in either stand alone, or C/S (on the server)

I have deamons running (process which execute in a repeat until(exit
4D) loop)
There is no reason (see below) based on the code in the deamons, that
these deamons can not be set to run in preemptive mode.
 
One of the ways to ensure a "clean" exit of these processes/code,
pointed out by Tim was to use
Set Process Variable to set a boolean process variable in the deamon

>Tech Tip: Always make sure your Stored Procedure is able to gracefully quit
http://kb.4d.com/assetid=77839

This leads to 2 questions
1 - doesn't this idea 'break' with preemptive code (using Set Process
Variable)?
    (I think that to get around the Set process variable you would use
'Storage')
2 - how does 4D know/stop/manage code lie the following from doing
executing Set Process Variable into a preemptive process?

$Execute:="SET PROCESS VARIABLE("+String($Process_ID)+\
Semi_Colon_Char+$Variable+Semi_Colon_Char+$Value+")"
EXECUTE FORMULA($Execute)

Where $Process_ID is a preemptive process

Thanks
Chip


On Thu, 12 Jul 2018 23:12:59 +0800, Alan Chan via 4D_Tech wrote:

> Why not? It isn't supported? I just checked In Transaction in trigger
> is a preemptive compliant. It means, preemptive mode does expect
> transaction. Any hidden constraint?
>
> Without transaction, trigger is meaningless. When a trigger invoked,
> mulitple tables might be updated inside the trigger. When trigger was
> rejected, other updated tables won't roll back except the trigger
> invoking table. This would cause serious
> data integrity issue.
>
> Alan Chan
>
> 4D iNug Technical <[hidden email]> writes:
>> transactional data entry is kind of task you would typically want to
>> avoid using preemptive mode.
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: just a curiosity - pre emptive threads

4D Tech mailing list
May be using Shared Object to replace variable.

Alan Chan

4D iNug Technical <[hidden email]> writes:
>1 - doesn't this idea 'break' with preemptive code (using Set Process
>Variable)?
>    (I think that to get around the Set process variable you would use
>'Storage')
>2 - how does 4D know/stop/manage code lie the following from doing
>executing Set Process Variable into a preemptive process?

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: just a curiosity - pre emptive threads

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Oops... I reply too fast. You've answered your question.

Alan Chan

Chip Scheide <[hidden email]> writes:
>(I think that to get around the Set process variable you would use
>'Storage')

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