Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Noticias
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Colaboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 11-06-2007
Avatar de mamcx
mamcx mamcx is offline
Moderador
 
Registrado: sep 2004
Ubicación: Medellín - Colombia
Posts: 3.939
Poder: 27
mamcx Tiene un aura espectacularmamcx Tiene un aura espectacularmamcx Tiene un aura espectacular
Cita:
Empezado por jachguate
Hay otras cosas que no entiendo que hacen en el roadmap, pues son cosas que ya existen y para quienes no conocen el producto, esto da la idea de que no existiesen actualmente, cosas como
Quizas lo de RIIA un poco por medio de Intraweb (sera que apuntan a una solucion propia??).

Pero lo de multicore? Pa' que entiendas por donde *deberia* de ser la vuelta de la programacion multi-core un vistazo a:

http://erlang.org/doc/doc-5.5.4/doc/...art_frame.html

Y para una explicacion del porque el estilo actual no sirve (y el de erlang si ):

http://www.defmacro.org/ramblings/concurrency.html

Ese es el camino a tomar.


Hace un par de meses intente hacer una implemtacion de erlang concurrency en delphi pero no soy tan hacker y quede a 1/4 de camino

Código Delphi [-]
unit ParallelCode;

interface

uses
  {VCL}Classes ,
  {JCL}JclContainerIntf,JclQueues,JclAlgorithms,JclHashMaps;

type
  TBufferType = (tbInt,tbString,tbData);

  IParallelCode = interface
    function GetSession(key: String): TObject;
    procedure SetSession(key: String; const Value: TObject);

    procedure Post(PID:Integer;Value:String);

    procedure BroadCast(PidList: array of Integer;Value:String);overload;
    procedure BroadCast(Value:String);overload;
    procedure Execute;
    procedure Get(FromPID:Integer;Value:String);

    property Session[key:String]:TObject read GetSession write SetSession;

    function GetIsDone: Boolean;
    function GetPid: Integer;
  end;

  TParallelCode = class(TInterfacedObject,IParallelCode)
  private
    FPId : Integer;
    FSession: IJclStrIntfMap;
    FIsDone: Boolean;
    function GetIsDone: Boolean;
    function GetPid: Integer;
    function GetSession(key: String): TObject;
    procedure SetSession(key: String; const Value: TObject);
  protected
    FApply:TApplyFunction;
    FValue:TObject;

    procedure DoPost(PID:Integer;Value:TStream;DataType:TBufferType);virtual;
  public
    procedure Execute;

    procedure Post(PID:Integer;Value:String);

    procedure BroadCast(PidList: array of Integer;Value:String);overload;
    procedure BroadCast(Value:String);overload;

    procedure Get(FromPID:Integer;Value:String);

    property Session[key:String]:TObject read GetSession write SetSession;

    property IsDone:Boolean read GetIsDone;

    property PID:Integer read GetPid;

    constructor Create(Apply:TApplyFunction;Data:TObject;AutoStart:Boolean=True);
    destructor Destroy; override;

end;

implementation

{ TParallelCode }

procedure TParallelCode.BroadCast(PidList: array of Integer; Value: String);
var
  Pid:Integer;
begin
  for Pid in PidList do
  begin
    Post(Pid,Value);
  end;//for
end;

procedure TParallelCode.BroadCast(Value: String);
begin

end;

constructor TParallelCode.Create(Apply: TApplyFunction; Data: TObject;AutoStart:Boolean=True);
begin
  FSession := TJclStrIntfHashMap.Create();

  FApply := Apply;
  FValue := Data;

  if AutoStart then
  begin
    Execute;
  end;
end;

destructor TParallelCode.Destroy;
begin
  Post(-1,'Terminado');

  FSession.Clear;
  FApply := nil;
  FValue := nil;
  inherited;
end;

procedure TParallelCode.DoPost(PID: Integer; Value: TStream;
  DataType: TBufferType);
begin

end;

procedure TParallelCode.Execute;
var
  value:Integer;
begin
  Value := Integer(FApply(FValue));
end;

procedure TParallelCode.Get(FromPID: Integer; Value: String);
begin

end;

function TParallelCode.GetIsDone: Boolean;
begin

end;

function TParallelCode.GetPid: Integer;
begin

end;

function TParallelCode.GetSession(key: String): TObject;
begin
  Result := nil;
end;

procedure TParallelCode.SetSession(key: String; const Value: TObject);
begin

end;

procedure TParallelCode.Post(PID: Integer; Value: String);
var
  Bufer: TStringStream;
begin
  Bufer := TStringStream.Create(Value);

  DoPost(PID,Bufer,tbString);
end;

end.

Código Delphi [-]
unit FastCore2;

interface

uses {VCL} Windows, Classes, Messages ,
     {JCL}JclContainerIntf,JclQueues,JclAlgorithms,JclArrayLists, Coroutine;

type
  TPIdList = array of Integer;

  TForkManager= class(TObject)
  private
    FList: IJclIntfArray;
  public

  end;

  TForkMethod = class(TCoroutine)
  end;

  TFork = class(TObject)
  private
    FPId : Integer;
    FSession: IJclIntfArray;
  protected
    FApply:TApplyFunction;
    FValue:TObject;
    procedure Run;
  public
    property Session:IJclIntfArray read FSession;
    property PID:Integer read FPid;

    procedure Send(PID:Integer;data:String);

    constructor Create(Apply:TApplyFunction;Data:TObject);
    destructor Destroy; override;
  end;

function Fork(TheFunction : TApplyFunction; Data:TObject):TPIdList;
//function Fork(Functions : array of TApplyFunction):TPIdList;overload;

implementation

{Funciones}
function Fork(TheFunction : TApplyFunction;Data:TObject):TPIdList;
begin
  TFork.Create(TheFunction, Data);
end;

{
function Fork(Functions : array of TApplyFunction):TPIdList;
var
  funct: TApplyFunction;
begin
    for funct in Functions do
    begin
      TFork.Create(funct);
    end;

    Result := nil;
end;
}
{ TFork }

constructor TFork.Create(Apply:TApplyFunction;Data:TObject);
begin
  FSession := TJclIntfArrayList.Create();
  FPId := 1;
  FApply := Apply;
  
  Run();
end;

destructor TFork.Destroy;
begin
  inherited;
end;

procedure TFork.Run;
var
  value:Integer;
begin
  Value := Integer(FApply(FValue));
  Send(FPId,'Papa');
end;

procedure TFork.Send(PID:Integer;data: String);
begin

end;

end.

Esto es parte del codigo. La idea era usar el algoritmo de map-reduce (muy famoso por lo de google), corutinas y un API similar al session de asp.net para guardar en memoria con llamadas faciles como:

Código Delphi [-]

Send(FPId=1,Datos);

procedure Process(FromPid,Datos)
begin
//Aqui recibe los mensajes
end;

y luego extender para que funcione por red tambien, a lo erlang.

Quede bloqueado con la parte de como usar los messages de windows y otras cosas...
__________________
El malabarista.
Responder Con Cita
  #2  
Antiguo 29-06-2007
SMTZ SMTZ is offline
Miembro
 
Registrado: nov 2003
Posts: 225
Poder: 23
SMTZ Va por buen camino
Smile other operating systems

A mí me da especial buen rollo lo de "other operating systems", ya que intuyo que Borland/Codegear quiere dejar de depender tanto de Microsoft tal y como ocurre actualmente, sino que estarían abiertos a más mercados a parte del de Microsoft. También, porque abre un esperanza a que los Linuxeros puedan tener algún día un IDE de una calidad muy alta, cosa que, en mi opinión, no existe ahora, al menos, no con una calidad equiparable a los IDEs de Borland para Windows (aunque Codegear no ha dicho nada de crear IDEs para Linux, únicamente de generar aplicaciones multiplataforma, pero por algo se empieza).
Personalmente, me encantaría poder programar en .NET sin pensar en el sistema operativo final donde correrá la aplicación, ya que me gusta .NET, pero prefiero Linux a Windows (Monodevelop deja mucho que desear en estos momentos y estoy acostumbrado a la sintaxis de Pascal). También ya es hora de que Delphi soporte .NET 2.0 y 3.0, ya que, por ejemplo, las librerias Borland.Provider sólo existen para Windows, por lo que una aplicación pensada para multiplataforma no funciona. Estás obligado a utilizar .NET nativo y entiendo (no he tenido la oportunidad de ratificarlo) que los componentes de conexión a las bases de datos, habrán mejorado en las últimas veriones de .NET... En fin, no me quiero entusiasmar demasiado, pero parece que llegan buenas noticias de mi IDE/Compilador favorito.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Publicado ReactOS 0.3.1 poliburro Noticias 0 12-03-2007 16:15:57
FAQ oficial sobre los turbo en español: mamcx Noticias 2 16-09-2006 02:34:42
Roadmap de Delphi - EKON 9!!! Epachsoft Noticias 6 29-09-2005 17:40:46
Update no oficial no.4 para Delphi 2005 Epachsoft Noticias 16 12-09-2005 15:59:45
Roadmap de Firebird guillotmarc Noticias 0 25-08-2004 13:08:51


La franja horaria es GMT +2. Ahora son las 16:27:05.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi