Multi-threads server side

There are a little bit complex point on the server side when OpenCL kernel’s arguments are passed, because if the server have platforms that uses OpenCL < 1.2 the type of the argument that client is passing can’t be tested, so is impossible to know if the argument is a memory object (buffers, images, samplers, …).
In OpenCL specification these types of objects are defined as pointers, property used intensively in ocland to speed as much as possible the memory transfers, but has the disadvantage that you must test the pointer in order to know if the pointer is valid. If a client pass an invalid pointer (intentionally or not), ocland is able to test it and return errors in order to avoid a segmentation fault in almost cases.
When an OpenCL instance is passed as kernel argument, ocland can’t test it, and if is a invalid pointer, some OpenCL platforms can crash (due to they are unable to know if the pointer is valid), shutting down the server.
In order to can manage this situation ocland-server now launchs independent threads per each client connected, improving also the speed somehow. In case that a thread crash, server can manage the situation and put as free the slot lost.

This entry was posted in Bugs, Development, Features and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s