diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-14 10:03:46 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-14 10:03:46 +0200 |
commit | 8d862231a0016dcf40f269e73d5b189606038490 (patch) | |
tree | 74ed9c53f45cbb951f42591e2d991f2d014339f0 | |
parent | 60d862ca1de4e5bd690dbc631bce15f08acffa13 (diff) |
libports: clarify why we emulate protected payloads
The Hurd uses protected payloads to improve the receiver lookup on the
server side to the point that we no longer do a hash table lookup in
the dispatch code.
If the kernel does not support protected payloads, we degrade
gracefully, do one lookup in libports' dispatching code, and emulate
the protected payload feature to still save one hash table lookup in
the intrans function.
* libports/manage-multithread.c (ports_manage_port_operations_multithread):
Add comment.
* libports/manage-one-thread.c (ports_manage_port_operations_one_thread):
Likewise.
-rw-r--r-- | libports/manage-multithread.c | 5 | ||||
-rw-r--r-- | libports/manage-one-thread.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c index dcb6905d..60743d93 100644 --- a/libports/manage-multithread.c +++ b/libports/manage-multithread.c @@ -175,6 +175,11 @@ ports_manage_port_operations_multithread (struct port_bucket *bucket, pi = ports_lookup_port (bucket, inp->msgh_local_port, 0); if (pi) { + /* Store the objects address as the payload and set the + message type accordingly. This prevents us from + having to do another hash table lookup in the intran + functions if protected payloads are not supported by + the kernel. */ inp->msgh_bits = MACH_MSGH_BITS ( MACH_MSGH_BITS_REMOTE (inp->msgh_bits), MACH_MSG_TYPE_PROTECTED_PAYLOAD); diff --git a/libports/manage-one-thread.c b/libports/manage-one-thread.c index 192907ac..b920338f 100644 --- a/libports/manage-one-thread.c +++ b/libports/manage-one-thread.c @@ -66,6 +66,11 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket, pi = ports_lookup_port (bucket, inp->msgh_local_port, 0); if (pi) { + /* Store the objects address as the payload and set the + message type accordingly. This prevents us from + having to do another hash table lookup in the intran + functions if protected payloads are not supported by + the kernel. */ inp->msgh_bits = MACH_MSGH_BITS ( MACH_MSGH_BITS_REMOTE (inp->msgh_bits), MACH_MSG_TYPE_PROTECTED_PAYLOAD); |