✓ Accepted answer
Edit
BlueTaslem has brought to my attention that pcall was indeed changed to be the same as ypcall. The explanation I gave was for the functions prior to the update. However there still is some potentially interesting stuff in there so I'll leave it there for informative purposes.
Yielding
In RBXLua, it is often important to to use function calls like wait() when you are trying to do things repeatedly, or else the client or server could slow or even freeze altogether. But why do we need to do this?
The reason is Thread Scheduling (which you can read about on the wiki)
When Roblox is processing scripts, It can only process one at a time and just switches between tasks on different scripts using a thread scheduler (this is why it's better to use fewer scripts). So if one task is hogging all the resources, then you can never switch to another task.
You can pause one task and let Roblox process other things by calling a YeildFunction such as wait().
pcall vs ypcall
So why can't pcall yield when ypcall can?
In order to figure out why we need to uncover what the meaning behind the error attempt to yield across metamethod/C-call boundary.
The function pcall is actually a C function which interprets Lua and will send you an error message. The problem is that yielding (with YeildFunctions) is Roblox specific and can not be interpreted by the pcall.
This error is saying that the metamethod used to yield can not be interpreted by the C code.
So this is where ypcall comes in. This function was made specific for Roblox and can interpret these YeildFunctions such as wait(). There are some other subtle technical differences that you can read about, but to put things simply it's a pcall that can yield.
Conclusion
If you need to yield, use ypcall. Otherwise use which ever you'd like as they are both close to identical speeds as far as I've seen.
4 comments
Thanks, I appreciate the explanation.
I thought ROBLOX changed the behavior of
pcallto be the same asypcall?Oh, wasn't aware of that. Thanks for more insight.
Turns out BlueTaslem is correct, I was unaware of the change