-
Notifications
You must be signed in to change notification settings - Fork 42
version 0.5 #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
version 0.5 #176
Conversation
That doesn't seem correct.
Are you implying that you do not want Rent~~ API? Since it is up to the user to use the Rent* api (a wrapper for Create in the first place), is there any reason to remove it? LuaThreads can use large amounts of memory, so there is a necessity to use pools. |
Fix error level
What's not right? In the current implementation, LuaState is essentially a wrapper around LuaMainThread, and the addition of
Too many options for users can confuse them. It would be better to add something like |
I meant that when we use CreateThread, we can call Resume from it.
Can you provide an approximate structure and APIs? |
C-Lua allows resuming threads created with
The API I propose is as follows. // Here, it is called state, but it needs to be possible to create it from any Lua thread
var thread = state.CreateThread();
try
{
// You can use the same API as LuaState
var results = await thread.DoStringAsync("foo()");
Console.WriteLine(results[0]);
}
finally
{
thread.Dispose();
}As for the internal implementation, there should be no problem if we use the current Currently, the implementation of LuaState and Lua threads are separated, but it may be good to integrate them like C-Lua. |
|
If we integrate LuaState and LuaThread, can I add LuaGlobalState to replace current LuaState? |
|
Is LuaGlobalState necessary? Why can't we just have LuaState? |
|
The reason is simply that we need a type to store information that is unique to current LuaState, such as platform, registry, packages, and so on. |
|
Wouldn't this be possible by creating a global state for LuaState to hold and sharing the same instance? Below is example code. The class names are merely examples and more appropriate names would be needed. class LuaState
{
readonly GlobalState global;
...
}
class GlobalState
{
LuaPlatform platform;
LuaTable registry;
LuaTable environment;
} |
|
In that form, would it be the almost same API split as LuaState/LuaThread? |
|
Well, that's certainly true. I guess we need LuaState and LuaThread after all. |
…ate to LuaGlobalState
Simplify LuaState and Platform
introduce StringInternPool.cs to reduce allocation and seq comp
|
Has this branch/version and project been abandoned, since the project owner is now working on another bindings project? |
|
Although development has slowed (due to my lack of involvement in maintenance, sorry), I still recognize the importance of Lua-CSharp. Although v0.5 has not yet reached release status, we will continue to develop it. |
reopen #135