Giter VIP home page Giter VIP logo

Comments (1)

bsrdjan avatar bsrdjan commented on September 17, 2024

I used node worker threads, not web workers. Do you mean these web workers nodejs/node#43583 ?

It looks like violation of RFC SDK threading rules, described on pg. 34 of SAP NetWeaver RFC SDK 7.50 Programming Guide

This seems to be an appropriate point to say a few words about thread-safety. Of course, the NW RFC Library is thread-safe in the sense that you can call any API simultaneously in different threads. However, that does not mean the application can also use the same “object”, like a connection or a table, in several threads at the same time and expect something reasonable to happen. Here are two typical examples, that were implemented in practice:
* A connection handle is shared between two threads and both of them are trying to execute a function call at the same time. Common sense already indicates that this can lead to no good. This would be similar to opening one single HTTP connection to an HTTP server and then sending two different GET or POST requests over that connection at the same time from two parallel threads. Even if the HTTP server would somehow be able to correctly recognize and serve both requests, there would be no guarantee as to which of the two threads receives which HTTP response... Most probably both threads would end up reading parts of each other’s responses.
As is the case with any kind of connection-based network programming (like HTTP connections, ODBC connections, etc.) an RFC_CONNECTION_HANDLE must not be shared between different threads.
* A table handle is shared across two threads, and both threads start filling rows into that table. Even if the insert operations were synchronized, it would not help: the end result would still be a completely intermingled sequence of thread A’s and thread B’s data, depending mainly on how the CPU distributes the time-slots between the two threads.
Therefore, for best performance, the NW RFC API does not synchronize any table operations and relies on table handles not being shared between two threads.
Consequently, as a general rule, all NW RFC library objects that are represented by a HANDLE, must not be shared across threads, the exception being immutable objects like metadata descriptions.

from node-rfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.