aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-06-13 19:04:18 +0100
committerUbitUmarov2017-06-13 19:04:18 +0100
commitad43cc6784b5422c5b7125a4f9356a3fa7fe2aee (patch)
tree59b8555f11cebc65a15ac2807037187a3a27a879 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
parentmake JobEngine be a workitem of mail pool (smartThread), with the option to r... (diff)
downloadopensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.zip
opensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.tar.gz
opensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.tar.bz2
opensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.tar.xz
change llclient async udp packets processing. Removed the shared Jobengine that made only one thread do some packets for all users, and removed the FireAndForget, so each user could issue a unlimited number of threads. Added a new JobEngine per client, so each gets at most one thread,and that thread can be released if iddle (for 5 seconds )
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d22f75e..54359eb 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -325,6 +325,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
325 /// </summary> 325 /// </summary>
326 public LLImageManager ImageManager { get; private set; } 326 public LLImageManager ImageManager { get; private set; }
327 327
328 public JobEngine m_asyncPacketProcess;
328 private readonly LLUDPServer m_udpServer; 329 private readonly LLUDPServer m_udpServer;
329 private readonly LLUDPClient m_udpClient; 330 private readonly LLUDPClient m_udpClient;
330 private readonly UUID m_sessionId; 331 private readonly UUID m_sessionId;
@@ -378,7 +379,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
378 protected Scene m_scene; 379 protected Scene m_scene;
379 protected string m_firstName; 380 protected string m_firstName;
380 protected string m_lastName; 381 protected string m_lastName;
381 protected Thread m_clientThread;
382 protected Vector3 m_startpos; 382 protected Vector3 m_startpos;
383 protected UUID m_activeGroupID; 383 protected UUID m_activeGroupID;
384 protected string m_activeGroupName = String.Empty; 384 protected string m_activeGroupName = String.Empty;
@@ -529,7 +529,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
529 m_prioritizer = new Prioritizer(m_scene); 529 m_prioritizer = new Prioritizer(m_scene);
530 530
531 RegisterLocalPacketHandlers(); 531 RegisterLocalPacketHandlers();
532 532 string name = string.Format("AsyncInUDP-{0}",m_agentId.ToString());
533 m_asyncPacketProcess = new JobEngine(name, name, 10000);
533 IsActive = true; 534 IsActive = true;
534 } 535 }
535 536
@@ -592,6 +593,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
592 if (OnConnectionClosed != null) 593 if (OnConnectionClosed != null)
593 OnConnectionClosed(this); 594 OnConnectionClosed(this);
594 595
596 m_asyncPacketProcess.Stop();
595 597
596 // Flush all of the packets out of the UDP server for this client 598 // Flush all of the packets out of the UDP server for this client
597 if (m_udpServer != null) 599 if (m_udpServer != null)
@@ -778,12 +780,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
778 cinfo.AsyncRequests[packet.Type.ToString()]++; 780 cinfo.AsyncRequests[packet.Type.ToString()]++;
779 781
780 object obj = new AsyncPacketProcess(this, pprocessor.method, packet); 782 object obj = new AsyncPacketProcess(this, pprocessor.method, packet);
781 783/*
782 if (pprocessor.InEngine) 784 if (pprocessor.InEngine)
783 m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); 785 m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
784 else 786 else
785 Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); 787 Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString());
786 788*/
789 m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
787 result = true; 790 result = true;
788 } 791 }
789 else 792 else
@@ -841,6 +844,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
841 844
842 public virtual void Start() 845 public virtual void Start()
843 { 846 {
847 m_asyncPacketProcess.Start();
844 m_scene.AddNewAgent(this, PresenceType.User); 848 m_scene.AddNewAgent(this, PresenceType.User);
845 849
846// RefreshGroupMembership(); 850// RefreshGroupMembership();