8

Is JavaScript multithreading possible in IE6?

Are there any third party libraries for this?

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
Dilip
  • 91
  • 3

6 Answers6

11

JavaScript does not support native multithreading in current web browsers. Even if it did, I bet IE 6 wouldn't have supported it :)

Running your scripts in multiple iframes could be one workaround, as Jason Kester suggested in another answer.

In addition, for modern browsers you might be interested in checking out Web Workers, but this is definitely something out of the IE 6's league:

Community
  • 1
  • 1
Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
3

Run your tasks in IFrames

Assuming you're talking about multitasking on the client side, you can open n frames on your page, each pointed to a page on your domain.

There are lots of ways to architect it from there. Probably the easiest would be to have a single .js include that you run from each frame. It phones home to parent.readyToGo() or whatever, and gets some work assigned. The worker methods can call something like parent.taskFinished() to report when they're done.

Most importantly, don't listen to anybody telling you not to run your mission critical multithreaded javascript application on IE6. I'm sure you have good reasons:)

Jason Kester
  • 5,951
  • 9
  • 35
  • 40
2

There is no way - definitely not in IE6. You can fake it by using lots of window.setTimeout()s.

See Why doesn't JavaScript support multithreading?

Community
  • 1
  • 1
Andras Vass
  • 11,478
  • 1
  • 37
  • 49
2

Well, HTML5 is coming up with Web-Workers. But i highly doubt there is a library which creates a wrapper for using it in IE6.

Does my browser support web workers?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
N 1.1
  • 12,418
  • 6
  • 43
  • 61
1

Google Gears is a plugin that works with IE6 and includes something called WorkerPools. Google Gears does not seem like it is being very actively developed anymore, because it has tried to move most of the ideas of Gears into HTML5. WorkerPools are basically background processes that do not share state and only communicate through messages. In HTML5 this has turned into WebWorkers. You can find more info here: http://code.google.com/apis/gears/api_workerpool.html

Russell Leggett
  • 8,795
  • 3
  • 31
  • 45
1

If you merely want to write synchronous code and thus avoid having to deal with writing event handlers all over the place, you can try: Strands

Dark Falcon
  • 43,592
  • 5
  • 83
  • 98