BASIC Developer & Support Resources > Compilers

OxygenBasic embeddable scripting interpreter

<< < (2/6) > >>



Threads are not intrinsic in Oxygen. We would use the Windows kernel thread functions directly. Do you want to initiate the threads in Oxygen the get them to do sb_load / sb_call operations? Just to get a clearer picture.


SB includes an API for pthread for threading and supports shared/session variable memory management. The MT extension module is the interface for the SB script side and the embedding API has the functions for creating SB aware threads and memory management. (why recreate the wheel?)

The main reason for the request to embed SB in O2 is a host compiler to spawn threads and provided OS based functionality not available at the SB script level.

Does this mean Oxygen would not need to deal directly with the threading aspect, making normal calls to SB?

The ScriptBasic embedding API has everything you need to do the integration. I thought it would be best to make the SB interface an O2 DLL or linkable library and keep O2 pure.

--- Quote ---You may want to have a peek at the SBHTTPD (multi-threaded webserver) as a guide. (ignore CGI & running as a service code)
--- End quote ---

The sbhttpd httpd multi-threaded server is a C based host embedding SB in a threaded way. Add running as a service and http/cgi support and there you go, a web server in ScriptBasic. The server application is fast and resource friendly.

Thanks John,

Were you able to make any sense of my source code BTW :)



[0] Message Index

[#] Next page

[*] Previous page

Go to full version