首页 \ 问答 \ Sencha触摸jQuery Mobile(Sencha Touch over jquery Mobile)

Sencha触摸jQuery Mobile(Sencha Touch over jquery Mobile)

Sencha Touch的主要功能是什么jQueryMobile我不明白。 根据我对这两项技术的了解:

1) jQueryMobile为跨平台移动平台的设计应用程序提供了非常简单的数据属性功能,但与Sencha Touch相比

2)与jQuery Mobile相比, Sencha Touch有一个新概念,它们的结构对于实现页面设计来说非常困难。

然后SenchajqueryMobile的意义是什么?他们在哪个领域扮演重要角色?


What is main feature of Sencha Touch over jQueryMobile I don't understand. as per my knowledge about this two technology:

1) jQueryMobile have very simple data attribute feature for design app for cross mobile platform but as compare to Sencha Touch.

2) Sencha Touch have new concept and their structure to implement designing for page is very difficult compare to jQuery Mobile.

Then What is significance of Sencha and jqueryMobile and What is their own area in Which they both play role significantly ?


原文:https://stackoverflow.com/questions/17807056
更新时间:2023-08-21 08:08

最满意答案

您可以将所需的任何数据传递给Thread.Start()方法。 这基本上是在线程之间共享内容的首选方式。 但是,在基本级别,如果多个线程要访问其他线程,那么您需要建立某种锁定机制以确保您没有争用问题。

假设您在线程之间共享一个全局级别的类实例:

(这是C#,但你明白了)

class GlobalData {

    public string SomeProperty {get; set; }
    public int SomeOtherProperty {get; set; }

}

多个线程同时访问这些属性中的任何一个(或者期望值在调用之间保持一致)的情况将会很麻烦。 所以最简单的方法是创建一个线程负责的锁定机制:

class GlobalData {

    public object Sentry = new object();

    public string SomeProperty {get; set; }
    public int SomeOtherProperty {get; set; }
}

在运行线程的代码中,你会做这样的事情(假设g_Data是类的实例):

void SomeMethodRunningOnAThread() {
    lock (g_Data.Sentry) {
        // do stuff    
    }
}

(在VB.NET中相当于lockSyncLock

这是确保您不会遇到争用问题的最简单方法。 每个线程负责确保在访问对象之前尝试锁定对象。

除此之外,当然还有一些方法可以对此进行细化,例如在包含全局数据的类中实现锁定逻辑。 它不会变得那么复杂,所以如果你想要实现更复杂的东西,你最后还是必须阅读。


You can pass any data you want to the Thread.Start() method. That's basically the preferred way of sharing stuff between threads. However, at a basic level, if more than one of the threads is going to access something that the others will as well, you need to establish some kind of locking mechanism to ensure you don't have contention issues.

Let's say you have a class instance at the global level that is shared among your threads:

(this is C# but you get the idea)

class GlobalData {

    public string SomeProperty {get; set; }
    public int SomeOtherProperty {get; set; }

}

A scenario where more than one thread accesses any of these properties at the same time (or expect the value to be consistent across calls) would be trouble. So the easiest way is to create a locking mechanism where the thread is responsible:

class GlobalData {

    public object Sentry = new object();

    public string SomeProperty {get; set; }
    public int SomeOtherProperty {get; set; }
}

In the code that runs the threads, you would do something like this (assuming g_Data is the instance of the class):

void SomeMethodRunningOnAThread() {
    lock (g_Data.Sentry) {
        // do stuff    
    }
}

(in VB.NET the equivalent to lock is SyncLock)

This is the simplest way to ensure you don't get into contention issues. Each thread is responsible for ensuring that they are attempting a lock on the object before accessing its contents.

Beyond that, there are of course ways to finesse this, such as implementing the lock logic within the class that contains the global data. It doesn't get less complicated, so if you want to implement something more complex in the end you'll have to read up anyway.

相关问答

更多
  • 不要在多线程中“努力”:只需锁定连接的Stopwatch对象即可更新/读取它! var sw = socketInformation.GetStopwatch(); lock (sw) sw.Start(); 后来在另一个帖子中: var sw = socketInformation.GetStopwatch(); lock (sw) { sw.Stop(); long pingTime = sw.ElapsedMilliseconds; } Don't be a "try hard" at ...
  • 您可以将所需的任何数据传递给Thread.Start()方法。 这基本上是在线程之间共享内容的首选方式。 但是,在基本级别,如果多个线程要访问其他线程,那么您需要建立某种锁定机制以确保您没有争用问题。 假设您在线程之间共享一个全局级别的类实例: (这是C#,但你明白了) class GlobalData { public string SomeProperty {get; set; } public int SomeOtherProperty {get; set; } } 多个线程同时 ...
  • 在你的例子中,使Controller c final成为可能,然后通过构造函数或setter方法将它传递给GUI。 例如: final Controller c = new Controller(....) ; if(.... ) //manager { if (jRadioButton1.isSelected()) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() ...
  • 以下是解释: 跨线程从第三方dll访问COM对象 。 应该使用: CoInitialize(0); CoInitializeEx(NULL, COINIT_MULTITHREADED); Here is the explanation: Access a COM object from a 3rd party dll across threads . Should use: CoInitialize(0); CoInitializeEx(NULL, COINIT_MULTITHREADED);
  • 我不明白你的请求是如何可能的,至少不是没有一些非常聪明的无锁数据结构; 如果多个线程需要插入散列到同一位置的新值,会发生什么情况? 在以前的工作中,我使用了RwLock>> 。 在哈希值中插入值时,您会在短时间内获得排它锁定。 剩下的时间,你可以拥有多个线程,读取器锁定HashMap ,从而给一个给定的元素。 如果他们需要改变数据,他们可以独占访问Mutex 。 这是一个例子: use std::collections::HashMap; use std::sync: ...
  • 因为该字段不是静态的 。 它只适用于静态字段。 如果这是4.0,可能看看ThreadLocal Because that field isn't static. It only applies to static fields. If this is 4.0, maybe look at ThreadLocal
  • 看看下面的例子。 public class Worker { public SharedData state; public void Work(SharedData someData) { this.state = someData; while (true) ; } } public class SharedData { X myX; public getX() { ... } public setX(anX) ...
  • 显然,您需要有关这些地址中发生的更多信息。 我建议使用pin的RTN_ *和IMG API来获取有关正在执行的例程的更多信息,然后检查反汇编程序中的相关图像。 您可以按代码源过滤访问,而不是按内存过滤。 只需避免使用作为系统库一部分的指令。 关于注释中的讨论,还应考虑您未检测到库使用的同步机制的情况。 Obviously you need more information about what's happening in these addresses. I recommend using pin's R ...
  • Java中的并发执行通常依赖于“共享内存”,因此只需确保两个线程中的代码共享对可以交换信息的公共数据结构的引用。 您需要确保的是,以同步/线程安全的方式访问此结构。 这可以通过使用synchronized关键字(不推荐)或使用java.util.concurrent包中的类(推荐)手动完成。 BlockingQueue可能很适合你。 你上这堂课时遇到了什么问题? 问题是从BlockingQueue读取的线程需要区分BlockingQ中写入的数据(来自user1,2,3的数据......)。 我建议你为Use ...
  • 多处理使用单独的进程 ,而不是线程 。 这些进程不像线程一样共享所有内存。 要在进程之间共享数据 ,您可以使用例如multiprocessing.Value或multiprocessing.Array 。 但请注意,在某些情况下,您需要额外的锁定 。 使用Manager对象,您可以共享大多数数据类型(我认为它必须是可拾取的)。 共享内存的速度较慢。 或者您可以创建一个multiprocessing.Pipe来在进程之间交换数据。 备注 : 多处理模块在内部使用线程进行内务处理。 通常,最好避免在进程之间发送 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)