Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
Viewing User Profile for: Helg37
About Contact
Joined: Jan 4, 2011 04:06 AM
Last Post: Jan 29, 2011 12:45 AM
Last Visit: Mar 20, 2011 02:32 AM
Website:  
Location:
Occupation:
Interests:
AIM:
ICQ:
MSN IM:
Yahoo IM:
Post Statistics
Helg37 has contributed to 6 posts out of 21244 total posts (0.03%) in 4,954 days (0.00 posts per day).

20 Most recent posts:

Hello !
Do not quite understand your question, but issues of implementation of Data Feed processing in my humble opinion is a question a specific developer.
I showed an example, one way of handling a strong Data Feed. Details are already on the accurate implementation of the code by yourself. I do not claim purity of the sample code, but this scheme really works for me. But the code sample may be not optimal.


This is an example of logic that I use for processing Data Feed

using System.Threading;
using System.Collections.Concurrent;

public ConcurrentQueue<Prints> prints;
private EventWaitHandle wh_prints;
Thread worker_print;
static object locker = new object();

prints = new ConcurrentQueue<Prints>();
wh_prints = new AutoResetEvent(false);

worker_print = new Thread(WorkPrint);
worker_print.Start();

Prints pq = null;
GetPrint(pq);
worker_print.Join();
wh_prints.Close();
worker_print.Abort();

public void GetPrint(Prints pq)
{
lock (locker)
{
prints.Enqueue(pq);
wh_prints.Set();
}
}

void WorkPrint()
{
while (true)
{
Prints pq = null;
if (!prints.IsEmpty)
{
if (prints.TryDequeue(out pq))
{
if (pq == null)
{
return;
}
}
else
continue;
}

if (pq != null)
{
lock (locker)
{
………………
}
}
else
wh_prints.WaitOne();
}
}


Hello !
I use queue of "supplier-consumer" ConcurrentQueue.
In queue data is added, and another thread takes them and work.

IQFeed Developer Support » C# samplem with tcp/ip Jan 12, 2011 03:54 PM (Total replies: 45)

please send me an example on С # for TCP / IP

IQFeed Developer Support » Support for 64 bit processors Jan 4, 2011 09:03 AM (Total replies: 4)

thanks

IQFeed Developer Support » Support for 64 bit processors Jan 4, 2011 04:11 AM (Total replies: 4)

Is there a similar restriction for the library NET for x64 for development on C# ?


Time: Sat July 27, 2024 4:08 AM CFBB v1.2.0 13 ms.
© AderSoftware 2002-2003