Font Size: a A A

A Parallel Programming Model For Shared Persistent Memory On Node.js

Posted on:2020-07-06Degree:MasterType:Thesis
Country:ChinaCandidate:Q P ZhangFull Text:PDF
GTID:2428330623463638Subject:Computer technology
Abstract/Summary:PDF Full Text Request
JavaScript is a lightweight script language widely used in client-side browsers.Since its invention,JavaScript has developed rapidly,and almost all web pages use JavaScript now.Node.js is a JavaScript runtime environment,allowing Javascript to be used for building scalable network applications on server side.However,since JavaScript is designed as a single-threaded language,the Node.js runtime and the underlying Google V8 virtual machine are single-threaded as well.Thus Node.js doesn't support parallel programming,which makes it difficult for developers to enhance applications' performance.Meanwhile,as a new memory and storage structure,persistent memory(PM)shows optimistic prospects of being used in server-side applications.At present,few researches do exist in allowing script languages to support PM-based parallel programming.In this paper,we propose a parallel programming model called SPMP,which is a JavaScript support for shared persistent memory on Node.js.In SPMP,we first design and implement a PersistentArrayBuffer(PAB)object,it functions like ArrayBuffer in Node in that it visits and manages memory with a binary data buffer.The difference between the two lies in the design of access mechanism.PAB is designed to cater to the usage of PM,so it can be used to manage persistent memory.When SPMP is used to solve concurrent tasks,each process needs to hold a PAB in its address space,which is responsible for allocating,managing and accessing PM.Multiple processes can map their PABs to the same memory region to realize shared PM,and then communicate with each other via the shared memory.To ensure the efficency and load balance of the multiple processes,we design three different parallel mechanisms for different scenarios.For the consistency control problems which are common in concurrent programming,we design atomic operations to avoid write contradiction,repeat write,dead lock,and so on.Besides support of PM,SPMP can also be used in the RAM-disk structure to ensure the persistence of data in memory.We compare SPMP against Extended Memory Semantics(EMS,a state-of-art model for parallel programming on Node.js)on two data-intensive tasks.The results show that SPMP is 100 ? 300× faster than EMS on STREAMS,and 2× faster on complicated parallel computing tasks such as counting words,due to its particular way on memory allocation and mapping.
Keywords/Search Tags:JavaScript, Node.js, Persistent memory, Shared memory, Parallel programming, Dynamic load balance
PDF Full Text Request
Related items