首页 \ 问答 \ 并发编程和并行编程有什么区别?(What is the difference between concurrent programming and parallel programming?)

并发编程和并行编程有什么区别?(What is the difference between concurrent programming and parallel programming?)

并发编程和并行编程有什么区别? 我问谷歌,但没有找到任何帮助我理解这种差异的东西。 你能给我一个例子吗?

现在我发现这个解释: http : //www.linux-mag.com/id/7411 - 但是“并发是程序的属性”vs“并行执行是机器的属性”对我来说还不够 - 我还不能说什么是什么。


What is the difference between concurrent programming and parallel programing? I asked google but didn't find anything that helped me to understand that difference. Could you give me an example for both?

For now I found this explanation: http://www.linux-mag.com/id/7411 - but "concurrency is a property of the program" vs "parallel execution is a property of the machine" isn't enough for me - still I can't say what is what.


原文:https://stackoverflow.com/questions/1897993
更新时间:2023-01-30 06:01

最满意答案

我刚刚在BCL上搜索了WSAAccept函数。 从.NET 4.5开始,此函数未被使用。

使用PInvoke调用WSAAcceptSocket类允许您获取本机套接字句柄。 不幸的是, Socket类不允许您从句柄构造实例。 你必须执行一些讨厌的黑客来做到这一点。


I just searched the BCL for the WSAAccept function. This function is not being used as of .NET 4.5.

Call WSAAccept using PInvoke. The Socket class allows you to obtain the native socket handle. Unfortunately, the Socket class does not allow you to construct an instance from a handle. You'll have to perform some nasty hacks to do that.

相关问答

更多
  • 是的,将接口推送到共享库是首选解决方案。 然后,您只需要将此库分发给插件开发人员,这可以被视为轻量级,但插件将耦合到接口的精确版本。 另一种解决方案是基于约定的解决方案,其中插件编写器具有“符合”接口的类型,例如,在类上具有适当的方法,它们可以通过配置文件指向。 然后,您可以使用反射,IL生成等将其连接到具体的内部接口\ proxy。 这样做的好处是,插件不会硬连接到特定的接口版本,因此版本控制具有更大的灵活性。 您还可以通过维护所有版本的接口来考虑版本控制,例如IPlugin_1,IPlugin_2等。然 ...
  • 有几个很好的例子: 使用ReCaptcha与ASP.NET MVC由Derik Whittaker MVC reCaptcha - 制作reCaptcha更多MVC'ish。 ReCaptcha Webhelper在ASP.NET MVC 3 来自Google代码的ASP.NET MVC的ReCaptcha控件 。 这在Stack Overflow问题中也被覆盖了。 NuGet Google reCAPTCHA V2 for MVC 4和5 NuGet软件包 演示文件 There are a few gre ...
  • 我刚刚在BCL上搜索了WSAAccept函数。 从.NET 4.5开始,此函数未被使用。 使用PInvoke调用WSAAccept 。 Socket类允许您获取本机套接字句柄。 不幸的是, Socket类不允许您从句柄构造实例。 你必须执行一些讨厌的黑客来做到这一点。 I just searched the BCL for the WSAAccept function. This function is not being used as of .NET 4.5. Call WSAAccept using ...
  • 很容易就可以在Asp.net核心旁边使用Owin管道,而不是替代解决方案。 在本文中,有一种使用Owin和asp.net核心使用Asp.net Core实现Owin管道实现此体系结构的简单方法 easily you can use Owin pipeline beside Asp.net core, not as an alternative solution. in this article there is a simple way to implement this architecture usin ...
  • 在VB.NET中,你需要手动将你的接口契约与你的实现关联起来。 看看下面的例子: Interface MyInterface Sub Foo() End Interface Class TestClass Implements MyInterface Public Sub Test() Implements MyInterface.Foo Console.WriteLine("Test") End Sub Public Sub Foo() ...
  • 我想你正在寻找Dictionary(Of TKey, TValue) 。 有一些如何在MDSN文档中使用它的示例。 在dotnetperls上还有一些例子。 I think you are looking for Dictionary(Of TKey, TValue). There are some examples of how to use it in the documentation on MDSN. There are also some more examples on dotnetperls. ...
  • 接受字符串的Write和WriteLine函数仅代表您必须覆盖的最少一对函数。 在TraceListener中还有其他的写函数可以选择性地覆盖接受对象。 但是,TraceListener设计用于框架跟踪功能。 所以,如果你不打算使用这个类来“监听”跟踪通过框架的输出,你可能会更适合你的特定跟踪需求的界面。 也许继承自System.IO.TextWriter会更适合你的情况。 它有很多写入方法,但我相信它们通过Write和WriteLine路由所有的输出,所以如果你只是重写这两个函数,你可以免费获得很多。 T ...
  • INotifyPropertyChange的要点是报告属性更改。 就此而言,它应该由特定的模型类实现,而不是通用数据对象。 以PropertyDescriptor.AddValueChanged形式提供了这种对象的更一般的解决方案 - 因为PropertyDescriptor可以表示“虚拟”属性,例如DataRow字段或WPF附加属性。 The point of INotifyPropertyChange is to report property changes. To that extent, it's ...
  • 您将无效参数传递给WSAAccept() 。 如果套接字族是AF_INET ,则必须将指针传递给sockaddr_in ,而不是sockaddr 。 如果套接字族是AF_INET6 ,则必须将指针传递给sockaddr_in6 。 在任何一种情况下,您都必须传递一个addrlen值,该值是sockaddr_...的真实大小。 sockaddr_in address; int size = sizeof(address); c = accept(s, (sockaddr*)&address, &size); ...
  • 添加System.Data.SqlClient nuget包作为依赖项。 它有 // // Summary: // Represents an open connection to a SQL Server database. This class cannot be // inherited. public sealed class SqlConnection : DbConnection 所以你将能够做到 using System.Data.SqlClient; ... using ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。