Google App Engine是否支持C ++? [英] Does Google App Engine support C++?

查看:113
本文介绍了Google App Engine是否支持C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

App Engine主页上显示为Python环境编写的应用程序代码必须仅以Python编写.不支持以C语言编写的扩展程序."

The main App Engine page states "Application code written for the Python environment must be written exclusively in Python. Extensions written in the C language are not supported."

https://developers.google.com/appengine/docs/whatisgoogleappengine

我们需要将C/C ++应用程序移植到SaaS服务.可以使用Google App Engine完成吗?

We need to port a C/C++ app to a SaaS service. Can it be done with Google App Engine?

推荐答案

Google App Engine当前有四个运行时可用:Go,Java,Python& PHP.

There are currently four runtimes available for Google App Engine: Go, Java, Python & PHP.

不仅只有这些运行时可用,而且语言的功能也受到限制.您无法使用许多传统上可用的子系统来帮助您扩展Web应用程序.您链接的页面上提到的主要示例不允许打开套接字或写入文件系统.线程或执行耗时超过一分钟挂钟时间的计算是另一个常见的限制.

Not only are these the only runtimes available, but you're also limited in the capabilities of the language. Many traditionally available subsystems aren't available to you to help your web application scale. The primary examples on the page you linked to mention that opening sockets or writing to a filesystem aren't allowed. Threading or performing computations that take longer than a minute of wall clock time are another common limitation.

沙箱

应用程序在安全的环境中运行,该环境提供对底层操作系统的有限访问.这些限制使App Engine可以在多个服务器之间分配对应用程序的Web请求,并启动和停止服务器以满足流量需求.沙箱将您的应用程序隔离在其自己的安全,可靠的环境中,该环境独立于Web服务器的硬件,操作系统和物理位置.

The Sandbox

Applications run in a secure environment that provides limited access to the underlying operating system. These limitations allow App Engine to distribute web requests for the application across multiple servers, and start and stop servers to meet traffic demands. The sandbox isolates your application in its own secure, reliable environment that is independent of the hardware, operating system and physical location of the web server.

安全沙箱环境的局限性示例包括:

Examples of the limitations of the secure sandbox environment include:

  • 应用程序只能通过提供的URL提取和电子邮件服务访问Internet上的其他计算机.其他计算机只能通过在标准端口上发出HTTP(或HTTPS)请求来连接到应用程序.
  • 应用程序无法在任何运行时环境中写入文件系统.应用程序可以读取文件,但只能读取使用应用程序代码上传的文件.对于必须在请求之间保留的所有数据,应用程序必须使用App Engine数据存储区,内存缓存或其他服务. Python 2.7环境允许读取,写入和修改字节码.
  • 应用程序代码仅响应Web请求,排队的任务或计划的任务而运行,并且在任何情况下都必须在60秒内返回响应数据.发送响应后,请求处理程序无法生成子流程或执行代码.

Google App Engine的重点是编写基于它们提供的可伸缩服务构建的单线程应用程序.与传统的C/C ++应用程序开发相比,这是一个很大的转变,因为您需要使用Google的机制来存储数据,访问Internet上的其他资源,发送和接收电子邮件,缓存.这样做的原因是消除了应用程序中的瓶颈,以便可以根据请求需求启动和拆除大量应用程序实例.

The focus for Google App Engine is to write a single threaded application built upon the scalable services they provide. It's quite a paradigm shift from traditional C/C++ app development because you're required to use Google's mechanism for storing data, accessing other resources on the internet, sending and receiving email, caching. The reason for this is to eliminate bottlenecks in your application so that a large number of instances of your application can brought up and torn down based on request demands.

要将传统的C/C ++应用程序移植到GAE(以及许多其他SaaS)上,很可能需要进行大量重构,以利用您在SaaS平台上运行所获得的收益,需要进行重写.

Porting a traditional C/C++ app to GAE (and many other SaaS) will most likely require so much refactoring that a rewrite will be required to take advantage of the gains you can make running on a SaaS platform.

这篇关于Google App Engine是否支持C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆