首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > JavaScript > JavaScript线程

JavaScript线程

  • 资源大小:4.60 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: javascript Threads Threading

资 源 简 介

Summary: Most of the current browsers run javascript functions/loops within a single thread causing the browser to freeze while executing a long running loop or function, and may cause the browser to display the "Unresponsive script" message. This library attempts to work around those issues. JThread provides the following features: - 1. Allows starting multiple threads and running them concurrently. 1. Doesn"t freeze the browser while executing a long running loop within a thread. 1. Each running thread can be killed at any time. ## Example 1: ## //instantiate a JThread objectvar jThread = new JThread(loopBody, exitCondition);...//start threadjThread.run();...//kill threadjThread.kill();......//instantiate and run a JThread objectvar jThread = new JThread(loopBody, exitCondition).run();...//kill threadjThread.kill();... ## Example 2: ## //to loop through a big arrayvar bigArr = [...];//instanti

文 件 列 表

JThread
JThread.js
JThreadTest.html
spin_loader.gif

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP