Author Topic: [java] Rolling (Shared) Queue  (Read 8151 times)

0 Members and 1 Guest are viewing this topic.

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: [java] Rolling (Shared) Queue
« Reply #15 on: October 21, 2006, 05:17:14 pm »
That's what I am doing ;)

Offline AntiVirus

  • Legendary
  • x86
  • Hero Member
  • *****
  • Posts: 2521
  • Best
    • View Profile
Re: [java] Rolling (Shared) Queue
« Reply #16 on: October 22, 2006, 02:06:02 am »
Eww.. go to hell! :D
The once grove of splendor,
Aforetime crowned by lilac and lily,
Lay now forevermore slender;
And all winds that liven
Silhouette a lone existence;
A leafless oak grasping at eternity.


"They say that I must learn to kill before I can feel safe, but I rather kill myself then turn into their slave."
- The Rasmus

Offline Ender

  • x86
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: [java] Rolling (Shared) Queue
« Reply #17 on: October 22, 2006, 09:20:18 pm »
Don't think of it as parallel processing. Think of it as ordered processing. When order matters, you think of it as ordered processing yet implement it so that it has the quirks and efficiency of parallel processing. There will have to be some thread control for ordered processing. Each connection object should have a static variable isBusySendingMessage or something. A boolean per packet in which order matters.

EDIT1:

Do you "pipeline" the messages such that while one message is being sent, another is being converted into a packet? (No time to look at the code.)

EDIT2:

Sorry if this post was unhelpful. I don't have time to look at the code, but thought I may go with the chance that this may help.
« Last Edit: October 22, 2006, 09:38:04 pm by Ender »

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: [java] Rolling (Shared) Queue
« Reply #18 on: October 22, 2006, 11:34:13 pm »
Don't think of it as parallel processing. Think of it as ordered processing. When order matters, you think of it as ordered processing yet implement it so that it has the quirks and efficiency of parallel processing. There will have to be some thread control for ordered processing. Each connection object should have a static variable isBusySendingMessage or something. A boolean per packet in which order matters.
It does, the Queue's are on a different thread than QueueManager and all the relevant methods are synchronized.  Additionally there is a mandatory 500ms between processing new packets to ensure correct ordering with variable internet travel time.

Quote
Do you "pipeline" the messages such that while one message is being sent, another is being converted into a packet? (No time to look at the code.)
Packets are formed before they even get there, the only thing the PacketThread (encapsulates the socket) class has to do is retrieve the byte array.  And no they aren't pipelined even then.  I can explain in more detail, but its all in the code comments I think.

Quote
Sorry if this post was unhelpful. I don't have time to look at the code, but thought I may go with the chance that this may help.
More helpful than no post, thanks :)