Rgss3 question : what is the use of fiber and Proc?

Hi people I was working on my message system and I looked to the rtp message system...and I am not sure even if I check in the help file...what is the use of Fiber and Proc...

I know in what I understand Fiber serve for wait the system until the conditions is met right? 

but ..even if I readed the document files about Proc I am not sure if I understand the use of this... 

so people could be enough kind for explain me what is this and show some example in what I can use these two built_in_class instance 

thanks for any further answer 🙂
I suggest looking up a definition of "block", "proc", "lambda" and "closure" (maybe "yield", too). This should give you a general idea about their usage.

/edit: In general, blocks are anonymous methods, that can be passed to a method that is defined like this:

Code:
def test(&block)  yield "test"endtest {|a| p a}
Blocks can't be stored, but procs/lambdas can and are used to pass methods to be called later:
Code:
test = lambda {|a| p a}test.call("test")
I checked the help file about blocks but it's confuse me in what I would  use that I checked the window_messages and this what I concluded :

def update_fiber if @fiber @fiber.resume elsif $game_message.busy? && !$game_message.scroll_mode @fiber = Fiber.new { fiber_main } @fiber.resume else $game_message.visible = false end endof what I understand ....with what you say  

fiber.resumer permit to run the fiber? 

and when I call fiber with a method in bracket it's permit to store the method? or the block?
to keep it short, they are responsible for the magic of the parallel processes.
1 use of proc is to boost code performance(1 of my scripts gained 10+ average fps in my machine from this alone 😀 ).

For example, when a script has notetag values that are RGSS3 codes stored in strings, like:

<notetag val: NVX> # In data's noteboxNVX = "code_x" # In script editable regionNormally, it'll either be evaluated directly using eval when it's used, or it'll first be converted into a proc after reading the notetag values from the database and that proc will then be evaluated upon use instead:

eval(notetag_val) # using eval to evaluate the notetag valuesnotetag_val.call # using proc to evaluate the notetag valuesAlthough proc consumes more memory, ridiculously many procs(like 1,000,000+) need to be present to make the difference significant. On the other hand, proc runs much, much faster, and running hundreds of procs can be(depending on the machine) significantly faster than running hundreds of evals(if 10 notetag values are run per battler per frame, the number of procs/eval to be run per frame can be up to 120).

In general, the more frequent the code's executed, the more justified to use proc over eval for notetag values storing RGSS3 codes in strings, and vice versa. That's 1 use of proc 🙂

P.S.: That's because eval is extremely inefficient(slow) although extremely effective(evaluates any working code without restrictions). Also, procs are still much, much more expensive than direct method calls.
If i have procs in my configuration, i usually create instance methods from them at game start, since calling those is even faster than procs. In general i try to use eval only during startup or inside of methods that are called infrequently (and then it's mainly, because i'm too lazy to provide an additional parameter and use eval for setting "self").

Original thread: https://forums.rpgmakerweb.com/threads/rgss3-question-what-is-the-use-of-fiber-and-proc.40863/