2014-12-02 44 views
1

我注意到了tests中的那些函數。 有沒有關於它的任何文檔?mongo shell中的Thread和ScopedThread函數

如何通過mongo shell使用線程? 我可以在線程中共享遊標嗎? 如果我在線程中共享變量,是否需要鎖定變量?

這裏是複製粘貼的github上:

Thread = function(){ 
this.init.apply(this, arguments); 
} 
_threadInject(Thread.prototype); 

ScopedThread = function() { 
this.init.apply(this, arguments); 
} 
ScopedThread.prototype = new Thread(function() {}); 
_scopedThreadInject(ScopedThread.prototype); 

回答

0

我有一個response威爾伯克利(MongoDB的職員)

該代碼是jstests MongoDB的一部分。它沒有記錄 內部測試代碼,它可以隨時更改,而且它不打算 是人們在shell中用於多線程的東西。如果您要 想多線程訪問數據庫,請使用 的官方驅動程序,該語言支持多線程。