Questions tagged [executioncontext]

Refers to concept of an environment where code is evaluated and executed. This refers to global and function execution contexts, how control is switched between, how binding occurs in context etc.

Execution context is abstract concept of programming and is closely related to executing code itself and order how it will executed (execution stack), how pointers to objects are created and used and how they're divided from each other. Because of abstract nature of concept itself Execution context is closely tied to particular implementation in programming languages (Javascript for example). Check related tags

Resources

Related tags

196 questions
3
votes
1 answer

Need Clarification on Execution Context

function a(){ b(); var c; } function b(){ var d; } a(); var d; I would like clarification on the Execution Context for the code above. From what I understand, during the creation phase of Execution Context functions a and b are set as…
Roma Kim
  • 321
  • 1
  • 8
3
votes
1 answer

JS: If you call the function, the result is 3, but if you bind the context with f.call(f) - the result is 5

var f = function() { this.x = 5; (function() { this.x = 3; })(); console.log(this.x); }; var obj = { x: 4, m: function() { console.log(this.x); } }; f(); // 3 new f(); // 5 f.call(f); // 5 obj.m.call(f); // 5 If you call the…
GROL COON
  • 43
  • 5
3
votes
1 answer

`eval` declaration instantiation when calling context is evaluating formal parameter initializers

The note below the PerformEval abstract operation says: The eval code cannot instantiate variable or function bindings in the variable environment of the calling context that invoked the eval if the calling context is evaluating formal parameter…
user51462
  • 1,658
  • 2
  • 13
  • 41
3
votes
0 answers

ExecutionContext with Rate and Concurrency Limits

Suppose I have a simple HTTP client with a naïve method like this: def httpGet(url: String)(implicit ec: ExecutionContext): Future[String] = Future { io.Source.fromURL(url).mkString } Suppose also I call it against a server with a rate and…
Michael
  • 41,026
  • 70
  • 193
  • 341
3
votes
1 answer

Actual V8 implementation of JS execution stack

I am just curious. How exactly are JavaScript engines internally implementing the EMCAScript execution stack instructions. If you look at the code below, ECMAScript will expect us to create a Global execution context with an Environmental Record…
boyan
  • 31
  • 1
3
votes
1 answer

Why does adding a default parameter value change the behavior when modifying the arguments?

The first section is : var a = 1; function fn2(a) { arguments[0] = 20; var a = 22; console.log(a); console.log(arguments[0]); } fn2(a); The second section is: var a = 1; function fn2(a, b = 100) { arguments[0] = 20; …
Chor
  • 833
  • 1
  • 5
  • 14
3
votes
1 answer

Migration from Spring Batch 3 to 4

I'm trying to migrate from Spring Batch 3.0.6 to 4.1.1. I'm stuck handling Spring Batch's execution context data as explained here. What I would like is update tables batch_step_execution_context and batch_step_execution_context as follows, for each…
Samuel
  • 594
  • 1
  • 6
  • 22
3
votes
1 answer

Execution context and object in JavaScript

There's something about object, execution context in JS that I don't understand. When we create an object, does it create an execution context ? since an execution context is created when a function is invoked. And if it doesn't, so the object is…
Quoc-Hao Tran
  • 1,312
  • 3
  • 13
  • 20
3
votes
1 answer

scala.concurrent.Future.onSuccess execution time on different ExecutorService

I wanted to control the number of threads in ExecutionContext. So I created a instance of ThreadPoolExecutor and then created ExecutionContext from it. And I created some Futures and attached onSuccess callbacks on them. I expected each onSuccess…
jyshin
  • 841
  • 1
  • 8
  • 15
3
votes
1 answer

Why is the execution context of ES6 IIFEs and ES5 IIFEs different?

The title about sums up the question - this is the code example: !function() { console.log(this); // global object }(); (function() { console.log(this); // global object })(); () => { console.log(this); // {} }(); var x = (function()…
Zach Smith
  • 8,458
  • 13
  • 59
  • 133
3
votes
1 answer

Is ExecutionContext cleared after the thread is returned to thread pool?

It is written in the docs: When the thread pool reuses a thread, it does not clear the data in thread local storage or in fields that are marked with the ThreadStaticAttribute attribute. Therefore, when a method examines thread local storage…
Pavel Voronin
  • 13,503
  • 7
  • 71
  • 137
2
votes
1 answer

How to run futures in their own execution context and not on the Actor System dispatcher. [Scala|Akka]

How do we use src/main/resources/application.conf for the same where the dedicated dispatcher in our code would automatically lookup in application.conf for the dispatcher
2
votes
0 answers

What are the execution contexts in P2300R4?

I'm referring to P2300R4, which is long and difficult, given my current level, but I want to understand more about it. It refers to execution contexts since the beginning § 1. Introduction This paper proposes a self-contained design for a Standard…
Enlico
  • 23,259
  • 6
  • 48
  • 102
2
votes
1 answer

Avoid capturing current execution context when using Task.Run

I would like to create/run a task without capturing the current execution context. Is this possible? Consider the following sample: private static readonly AsyncLocal AsyncLocal = new AsyncLocal(); [TestMethod] public void…
2
votes
1 answer

Comprehension of Actor with ExecutionContext

As I understand Akka parallelism, to handle each incoming message Actor use one thread. And this thread contains one state. As is it so, sequential messages does't share this states. But Actor may have an ExecutorContext for execute callbacks from…
Jelly
  • 972
  • 1
  • 17
  • 40
1 2
3
13 14