mdbx 0.3.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3a90fc6fc59d9b07c20202548dc61f62914920e97cf82287e965271fc793624
4
- data.tar.gz: 482f4234263f09466cf5e95092c87785569822d89c1a24f0eb8dbb44e6d9766a
3
+ metadata.gz: 6b8f04217532c9bd383ac918ac4ba724fa31e7a1e43335c1f084f13189f87b00
4
+ data.tar.gz: 54b3b4818240872fa8f973dbf52f1f1f5680e8508642d2fa4534e9346ae76411
5
5
  SHA512:
6
- metadata.gz: 6c45e50413ccdce9afba4ccb58860833d02c9dda9dce7b961395e7bebe7ad3f2119d2d63b7d98be0673efb6023941fd036b41779dc9e144f891038f50c48b794
7
- data.tar.gz: c8d2bc1f6649a277286b51f0869c521404011fb0a772d23429cfae7fb4ea09eed7db1fe693b47ece0bcb03c16b5bee48672de4dd94c2905f0e7264d708d0549a
6
+ metadata.gz: 69df23a8da7d594571015ce0ab129582d9ca534eb10c127ffd0c046035ed13746fd0855aa796f3c228c750f6f34ddc052017e79df0f2c4bf649528ead6d91072
7
+ data.tar.gz: 6f35e9127312f645f7e2bf29be1644e3b67ad5a27e5f8ce6eb7e81d2b5b1a58610b8d8c1ba571df994054bc1d6d7d575073b6b5098c19dcb22f099647bab7aae
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- 3�g�+<^�QݪUZ閐�TJx����g"'ݩ��}��RP�^W NA��``^��$0�rV��p����֐/B�ū������
2
- /x62��� 4��4J�۸33���7e����a��7��݂/NA#��{���I��]g�L#�Lyu��m0�L��A��LZU�zVXM
3
- �:�0�F���8��(���#=���{ƯG-)?����ӱ�`�lx�����& \p��}���Q��m�l%���"p;���mK����� �����R�G�M�� �u8
1
+ ���G�3������*'�ݣ@��-�ۼp��@��#�o��VfW O&�`�4'ky�*a���2N
2
+ Zm6����X�]2{[<�|�NYl]����m�6l�,oX����D�fA�{�V���6Ơe��V��a��)O֖�ۖ��y��2����0�L��7�l8�rd�<�B��B�UT������(��AZv��<� v �~� ��]�ᆋ��"H/�K��0'R�ׅ���Fߛ�qxR�>��u�"VU-F�����?ʭd�Gv�yҾ���-"3Y~
data/History.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release History for MDBX
2
2
 
3
+ ---
4
+ ## v0.4.0 [2025-04-30] Mahlon E. Smith <mahlon@martini.nu>
5
+
6
+ Enhancements:
7
+
8
+ - Opening a long running transaction is now thread safe.
9
+
10
+
3
11
  ---
4
12
  ## v0.3.8 [2025-02-20] Mahlon E. Smith <mahlon@martini.nu>
5
13
 
@@ -465,6 +465,26 @@ rmdbx_in_transaction_p( VALUE self )
465
465
  }
466
466
 
467
467
 
468
+ /* Inline struct for transaction arguments, passed as a void pointer. */
469
+ struct txn_open_args_s {
470
+ rmdbx_db_t *db;
471
+ int rwflag;
472
+ };
473
+
474
+
475
+ /* Opens a transaction outside of the GVL. */
476
+ void *
477
+ rmdbx_open_txn_without_gvl( void *ptr )
478
+ {
479
+ struct txn_open_args_s *txn_open_args = (struct txn_open_args_s *)ptr;
480
+
481
+ rmdbx_db_t *db = txn_open_args->db;
482
+ int rc = mdbx_txn_begin( db->env, NULL, txn_open_args->rwflag, &db->txn );
483
+
484
+ return (void *)rc;
485
+ }
486
+
487
+
468
488
  /*
469
489
  * Open a new database transaction. If a transaction is already
470
490
  * open, this is a no-op.
@@ -476,7 +496,17 @@ rmdbx_open_txn( rmdbx_db_t *db, int rwflag )
476
496
  {
477
497
  if ( db->txn ) return;
478
498
 
479
- int rc = mdbx_txn_begin( db->env, NULL, rwflag, &db->txn );
499
+ struct txn_open_args_s txn_open_args;
500
+ txn_open_args.db = db;
501
+ txn_open_args.rwflag = rwflag;
502
+
503
+ void *result_ptr = rb_thread_call_without_gvl(
504
+ rmdbx_open_txn_without_gvl, (void *)&txn_open_args,
505
+ RUBY_UBF_IO, NULL
506
+ );
507
+
508
+ int rc = (int)result_ptr;
509
+
480
510
  if ( rc != MDBX_SUCCESS ) {
481
511
  rmdbx_close_all( db );
482
512
  rb_raise( rmdbx_eDatabaseError, "mdbx_txn_begin: (%d) %s", rc, mdbx_strerror(rc) );
@@ -1,5 +1,6 @@
1
1
 
2
2
  #include <ruby.h>
3
+ #include <ruby/thread.h>
3
4
  #include "extconf.h"
4
5
 
5
6
  #include "mdbx.h"
data/lib/mdbx.rb CHANGED
@@ -13,7 +13,7 @@ module MDBX
13
13
  extend Loggability
14
14
 
15
15
  # The version of this gem.
16
- VERSION = '0.3.8'
16
+ VERSION = '0.4.0'
17
17
 
18
18
 
19
19
  log_as :mdbx
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdbx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mahlon E. Smith
@@ -34,7 +34,7 @@ cert_chain:
34
34
  49pOzX5KHZLTS9DKeaP/xcGPz6C8MiwQdYrZarr2SHRASX1zFa79rkItO8kE6RDr
35
35
  b6WDF79UvZ55ajtE00TiwqjQL/ZPEtbd
36
36
  -----END CERTIFICATE-----
37
- date: 2025-02-20 00:00:00.000000000 Z
37
+ date: 2025-04-30 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: loggability
metadata.gz.sig CHANGED
Binary file