Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 135733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:50:14+00:00 2026-05-11T06:50:14+00:00

As far as I understand, all JavaScript code is event-driven and executes on a

  • 0

As far as I understand, all JavaScript code is event-driven and executes on a single browser thread.

However, I have some JavaScript functions that are called from within a SWF object sitting on the same page. Is this code run in the same manner as regular JS code, or is it on some separate Flash thread?

If it is on a separate thread, can I use setTimeout() to get it to run on the JS events thread? e.g.:

function calledFromFlash() {     setTimeout(doActualWork, 0); }  function doActualWork() {     // blah blah blah } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:50:14+00:00Added an answer on May 11, 2026 at 6:50 am

    It’s still on the same thread. However, for most practical purposes if you have such a long-running JavaScript that you’re worried your ‘main’ task might block the call from setTimeout, you should consider revisiting your underlying approach.

    Update for the bounty:

    To expand on the more general question of threading in JavaScript, there is a great discussion with a very revealing answer from Bobince. He cites some very interesting scenarios that might call into question whether we can truly consider JS to be single-threaded, and his conclusion is ‘not quite’.

    The conclusion of the comments, which I agree with, is that from the perspective inside the JS runtime, the universe is single-threaded, but because the infrastructure surrounding the JS sandbox is not single-threaded, it can reach inside the sandbox and muck with state in unexpected ways. From inside the runtime, some unknown entity can ‘suspend the laws of nature’ and change things around. But the runtime has no threading construct to handle that scenario natively.

    I think the most important way to approach the question is to ask what do we mean by multi-threadedness in a practical scenario? Usually threading issues come down to things like synchronization, which we have to assume the browser vendors have solved for us because again, JavaScript has no native construct for even trying to deal with it ourselves. Hand-wringing about threading does no good without the tools to fix it; no mutexes or locks.

    So setting aside those kinds of catastrophic problems, we’re down to things like maybe a value gets changed out from under us unexpectedly. But well-written code should be OK with that. Even in Bobince’ example, all the code involved is still code that we voluntarily included in the page (even wrote ourselves) so sure, it might be surprising if that code gets fired while your main callstack is ostensibly ‘blocked’. But again speaking to practical problems, what is the worst thing you could do to yourself in that scenario? Nothing too serious.

    So that’s my long way of saying: I don’t know of any documentation from the browser vendors where they say unequivocally whether their JS implementation is single-threaded or not, but I question whether that matters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer That sample from Wikipedia is doing NegaMax with Alpha/Beta pruning.… May 16, 2026 at 3:50 pm
  • Editorial Team
    Editorial Team added an answer The Correct(tm) way to specify search directories is with compiler… May 16, 2026 at 3:50 pm
  • Editorial Team
    Editorial Team added an answer If you're just trying to add CSS, you can see… May 16, 2026 at 3:50 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

As far as I understand hadoop architecture considers all machines to be equal with
I'm a C Newb I write lots of code in dynamic languages (javascript, python,
Some solution could probably be applicable to Windows, however I am not familiar with
I am trying to understand the internals of how jquery framework is written and
I'm going to be as specific and verbose as possible and include some of
I'm upgrading some image galleries on a university website (needs to be standards compliant,
Let's assume I browse a specific web page that uses JavaScript to update its
I am making a colour-picker using pure JavaScript and HTML. It consists of three
I am trying to learn some ASP.NET MVC. Please bear with me but asp.net
Can someone explain what were the reasons generics were introduced in Java? As far

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.