设计并行算法来预防 DDOS?
我的多核机器正在接收数据包并将它们均匀地分布在其核心之间(有点循环)。每个核心应仅根据其原始地址来决定是让数据包通过还是丢弃它。
我需要找到无锁算法和数据结构来实现这一点。你能帮忙吗?
My multicore machine is receiving packets and distributes them evenly (sort-of round robin) among its cores. Each core should decide whether to let the packet pass or drop it, depending solely on its origin address.
I need to find lock-less algorithm and data structure to allow this. Can you help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您喜欢使用 Java,或者查看 Java 源代码的设计,您可以选择一个随机密钥,然后从 http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html。给定队列,如果它是 http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html
大部分 java.util.concurrent 是由于到Doug Lea,在 http://gee.cs 上有相关信息。 oswego.edu/dl/concurrency-interest/index.html。
对于您的特定问题可能有点过分,但可能会满足对该领域数据结构信息的一般要求。
If you are happy to use Java, or look at the design of Java source, you could chose a random key and then retrieve a queue from http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html. Given the queue, you could add the packet to it without blocking if it was a http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html
Much of java.util.concurrent is due to Doug Lea, who has information on it at http://gee.cs.oswego.edu/dl/concurrency-interest/index.html.
Possibly overkill for your particular problem, but might satisfy a general request for info on data structures in this area.