Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: runtime/vm/message.h

Issue 11440035: Optimize the message queue for many active ports with few messages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge with caching changes. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_MESSAGE_H_ 5 #ifndef VM_MESSAGE_H_
6 #define VM_MESSAGE_H_ 6 #define VM_MESSAGE_H_
7 7
8 #include "vm/thread.h" 8 #include "vm/thread.h"
9 9
10 // Duplicated from dart_api.h to avoid including the whole header. 10 // Duplicated from dart_api.h to avoid including the whole header.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 public: 69 public:
70 MessageQueue(); 70 MessageQueue();
71 ~MessageQueue(); 71 ~MessageQueue();
72 72
73 void Enqueue(Message* msg); 73 void Enqueue(Message* msg);
74 74
75 // Gets the next message from the message queue or NULL if no 75 // Gets the next message from the message queue or NULL if no
76 // message is available. This function will not block. 76 // message is available. This function will not block.
77 Message* Dequeue(); 77 Message* Dequeue();
78 78
79 void Flush(Dart_Port port); 79 // Clear all messages from the message queue.
80 void FlushAll(); 80 void Clear();
81 81
82 private: 82 private:
83 friend class MessageQueueTestPeer; 83 friend class MessageQueueTestPeer;
84 84
85 Message* head_; 85 Message* head_;
86 Message* tail_; 86 Message* tail_;
87 87
88 DISALLOW_COPY_AND_ASSIGN(MessageQueue); 88 DISALLOW_COPY_AND_ASSIGN(MessageQueue);
89 }; 89 };
90 90
91 } // namespace dart 91 } // namespace dart
92 92
93 #endif // VM_MESSAGE_H_ 93 #endif // VM_MESSAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698