It depends on the quality of your implementation and your priorities. Threads have the potential to use less memory/share more, and might perform better or worse than processes depending on synchronization primitives you use. On the other hand, with the utter crap quality of browser implementations, do you really want the whole browser and all your tabs crashing when one bad site tricks the browser into allocating unbounded amounts of memory or worse?
Multi-process browser implementations are a lot like the privilege separation model in OpenSSH, vsftpd, etc. You're sacrificing some resources to have the kernel protect you against bugs in your code.
您可能需要多进程。由于当今大多数计算机和 Web 应用程序都属于第二类,因此多进程可能是当今更好的选择。这是因为进程允许您将每个选项卡分隔在其自己的沙箱中。这意味着如果一个选项卡崩溃,您不会丢失其他选项卡。
It depends on what your needs are.
If you are
Looking for a resource minimal browser
Not running heavy javascripts
Not having a lot of memory
Then you are probably going to go with multi threading.
However, if you are
Running many pages at once
Running resource intensive web applications
You probably are going to want multi-process. Since most computers and web applications fit in the second category today, Multi-Process is probably, today the better choice. This is because processes allow you to separate each tab in its own sandbox. That means if one tab crashes, you aren't going to lose the other tabs.
Threads: on Windows are usually best no matter what. Processes are resource hungry implementations on those systems.
Processes: are good if security / stability is a chief concern. Because one process going down is much less likely to bring the whole browser down. (But why should the browser be expected to crash?) And is easier to securely isolate using OS primitives, but at a cost of more system resources (how much depends on the OS).
Hybrid: AKA Using Processes and Threads. This is the best approach. Loading a certain number of components, using threads until the process becomes large enough to justify the additional overhead of another process (depending on the OS), and then creating another process.
What do you mean, 'which is a better choice'? You have to define "better" before you can discuss why one is better than the other. What are you goals, and what are their relative priorities? Which is most important, stability, memory usage, CPU time, number of kernel objects in use? The answer you want will require you to provide these priorities first. That is, you need to define what "better" is before we can help you decide which one is better.
Well i think every time we open a new tab , it creates a thread , and it is benificial as thread will not require another resoces and will not use more memory and your system spped will not get more affected.
I think a multi-process is a better approach. In multi-thread there are security issues, and we don't want some one to steal our credit card number. If one process becomes slow, due that whole browser would crash down,does not make sense. Where as if our browser is very specific to certain application like research only, which deals with only a subset of internet we can analyse the pros and cons of process and thread based browser. A multi-thread browser would sure be fast and easily synchronized.
发布评论
评论(6)
这取决于您的实施质量和您的优先事项。线程有可能使用更少的内存/共享更多的内存,并且可能比进程执行得更好或更差,具体取决于您使用的同步原语。另一方面,由于浏览器实现的质量非常糟糕,当一个坏网站欺骗浏览器分配无限量的内存或更糟的情况时,您真的希望整个浏览器和所有选项卡崩溃吗?
多进程浏览器实现很像 OpenSSH、vsftpd 等中的权限分离模型。您需要牺牲一些资源来让内核保护您免受代码中的错误的影响。
It depends on the quality of your implementation and your priorities. Threads have the potential to use less memory/share more, and might perform better or worse than processes depending on synchronization primitives you use. On the other hand, with the utter crap quality of browser implementations, do you really want the whole browser and all your tabs crashing when one bad site tricks the browser into allocating unbounded amounts of memory or worse?
Multi-process browser implementations are a lot like the privilege separation model in OpenSSH, vsftpd, etc. You're sacrificing some resources to have the kernel protect you against bugs in your code.
这取决于您的需求。
如果您正在
,那么您可能会选择多线程。
但是,如果您
您可能需要多进程。由于当今大多数计算机和 Web 应用程序都属于第二类,因此多进程可能是当今更好的选择。这是因为进程允许您将每个选项卡分隔在其自己的沙箱中。这意味着如果一个选项卡崩溃,您不会丢失其他选项卡。
It depends on what your needs are.
If you are
Then you are probably going to go with multi threading.
However, if you are
You probably are going to want multi-process. Since most computers and web applications fit in the second category today, Multi-Process is probably, today the better choice. This is because processes allow you to separate each tab in its own sandbox. That means if one tab crashes, you aren't going to lose the other tabs.
答案:这是一种权衡。
线程:无论如何,在 Windows 上通常是最好的。进程是这些系统上资源匮乏的实现。
流程:如果安全/稳定性是主要考虑因素,那么流程就很好。因为一个进程宕机导致整个浏览器宕机的可能性要小得多。 (但是为什么浏览器会崩溃?)并且使用操作系统原语更容易安全地隔离,但是以更多系统资源为代价(多少取决于操作系统)。
混合:又称为使用进程和线程。这是最好的方法。加载一定数量的组件,使用线程,直到进程变得足够大,足以证明另一个进程的额外开销(取决于操作系统),然后创建另一个进程。
Answer: It's a tradeoff.
Threads: on Windows are usually best no matter what. Processes are resource hungry implementations on those systems.
Processes: are good if security / stability is a chief concern. Because one process going down is much less likely to bring the whole browser down. (But why should the browser be expected to crash?) And is easier to securely isolate using OS primitives, but at a cost of more system resources (how much depends on the OS).
Hybrid: AKA Using Processes and Threads. This is the best approach. Loading a certain number of components, using threads until the process becomes large enough to justify the additional overhead of another process (depending on the OS), and then creating another process.
“哪个是更好的选择”是什么意思?在讨论为什么一个比另一个更好之前,你必须先定义“更好”。您的目标是什么?它们的相对优先事项是什么?稳定性、内存使用、CPU 时间、使用的内核对象数量哪个最重要?您想要的答案将要求您首先提供这些优先级。也就是说,您需要先定义什么是“更好”,然后我们才能帮助您决定哪一个更好。
What do you mean, 'which is a better choice'? You have to define "better" before you can discuss why one is better than the other. What are you goals, and what are their relative priorities? Which is most important, stability, memory usage, CPU time, number of kernel objects in use? The answer you want will require you to provide these priorities first. That is, you need to define what "better" is before we can help you decide which one is better.
好吧,我认为每次我们打开一个新选项卡时,它都会创建一个线程,这是有益的,因为线程不需要另一个资源,也不会使用更多内存,并且您的系统速度不会受到更大的影响。
Well i think every time we open a new tab , it creates a thread , and it is benificial as thread will not require another resoces and will not use more memory and your system spped will not get more affected.
我认为多进程是更好的方法。在多线程中存在安全问题,我们不希望有人窃取我们的信用卡号。如果一个进程变慢,整个浏览器就会崩溃,这是没有意义的。就好像我们的浏览器非常特定于某些应用程序(例如仅研究),它只处理互联网的一个子集,我们可以分析基于进程和线程的浏览器的优缺点。多线程浏览器肯定会快速且轻松同步。
I think a multi-process is a better approach. In multi-thread there are security issues, and we don't want some one to steal our credit card number. If one process becomes slow, due that whole browser would crash down,does not make sense. Where as if our browser is very specific to certain application like research only, which deals with only a subset of internet we can analyse the pros and cons of process and thread based browser. A multi-thread browser would sure be fast and easily synchronized.