fqaiser94 commented on code in PR #475:
URL: https://github.com/apache/iceberg-rust/pull/475#discussion_r1690620132


##########
crates/catalog/inmemory/src/catalog.rs:
##########
@@ -0,0 +1,1511 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! This module contains in-memory catalog implementation.
+
+use async_lock::Mutex;

Review Comment:
   I wasn't aware of `futures`/`futures::lock::Mutex` ๐Ÿ™‚ 
   
   The only difference I can see between the two is that `async_lock::Mutex` 
[docs](https://docs.rs/async-lock/latest/async_lock/struct.Mutex.html) state 
that: 
   ```
   The locking mechanism uses eventual fairness to ensure locking will be fair 
on average without sacrificing performance. This is done by forcing a fair lock 
whenever a lock operation is starved for longer than 0.5 milliseconds.
   ```
   
   Whereas `futures::lock::Mutex` 
[docs](https://docs.rs/futures/latest/futures/lock/struct.Mutex.html#fairness) 
state that: 
   ```
   This mutex provides no fairness guarantees. Tasks may not acquire the mutex 
in the order that they requested the lock, and itโ€™s possible for a single task 
which repeatedly takes the lock to starve other tasks, which may be left 
waiting indefinitely.
   ```
   
   Regardless, I've switched to `futures::lock::Mutex` since I don't think this 
should be an issue (and we can always re-evaluate in the future if it does 
become one). 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to