简体   繁体   English

如何使用Java将线程委派给多个服务器并跟踪哪个线程位于哪个服务器上

[英]How to delegate threads to multiple servers and keep a track in which thread is on which server using Java

We have a solution which runs on 13 servers. 我们有一个在13台服务器上运行的解决方案。 I wish to know how do we explicitly delegate threads to different servers and keep a track of which thread was on which server. 我想知道我们如何将线程显式委派给不同的服务器,并跟踪哪个线程在哪个服务器上。

Your application need to implement asynchronous event handling. 您的应用程序需要实现异步事件处理。 One instance (node) of the application will trigger an event to another instance. 应用程序的一个实例(节点)将触发另一个实例的事件。 On receiving the event, the second instance may decide what it should do. 在接收到事件之后,第二实例可以决定它应该做什么。 That way the thread on the first instance will delegate to a thread in the second instance. 这样,第一个实例上的线程将委派给第二个实例上的线程。 Once the second instance is done with the handling, it may notify back to the first instance. 一旦第二实例完成处理,它可以通知第一实例。 Not sure of the architecture of your product (messaging between multiple nodes, if there is any event handling mechanism which is already there etc). 不确定产品的体系结构(在多个节点之间进行消息传递,如果已经有事件处理机制等)。 You may like to check Node.js, Akka. 您可能想检查一下Akka的Node.js。 But not really sure if that will work for you. 但不是很确定那是否适合您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 创建一个允许通过线程和Java进行多个连接的套接字服务器 - Creating a socket server which allows multiple connections via threads and Java Java中的线程池实际上是停止()线程? - Thread pool in Java which actually stops() the Threads? 如何在Java中跟踪线程池中的Runnables? - How to keep track of Runnables in Thread Pool in Java? 如何在多个Java线程中使用COM服务器 - How to use COM servers in multiple Java threads Java中如何方便服务器线程和多个客户端线程之间的通信 - How to facilitate communication between the server thread and the multiple client threads in Java 在Java中从多个线程读取(不修改)不是线程安全的对象(如链接列表)是否安全? - Is it safe in Java to read (not modify) objects which are not thread safe (like linked list) from multiple threads? 哪些变量是java中多线程的accessbile? - Which variables are accessbile for multiple threads in java? Java 线程类如何确定哪个线程? - How Java Thread Class Determines Which thread? 创建一个套接字服务器和客户端,以允许通过线程和Java进行多个连接 - Creating a socket server and client which allows multiple connections via threads and Java 如何跟踪哪个对象属于哪个对象? - How to keep track of what object belongs to which object?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM