Hi,I want to be able to do the following:1. Start a single instance of KDB2. Execute typical data transactions KDB instance 13. At a specific time during the day, start KDB instance 24. At that same time, COPY the entire executing data entity value set@KDB instance 1 to @KDB instance 25. @ KDB instance 1, continue processing transactions (not copy?g anymore data to @KDB instance 2)6. @ KDB instance 2 process new, separate transactions (never copy?gany data ever to @KDB instance 1)I basically want to do a DNA/KDB+ ?fork/exec? ? what is best way to dothis?
charset=utf-8
X-Mailer: iPhone Mail (8B117)
In-Reply-To: <637846ca-4f6e-44c8-b7e7-d7e9162eb27f@b17g2000yqa.googlegroups.com>
Message-Id: <2B542662-E2D6-4F97-80F2-129DF5D04CFF@gmail.com>
Date: Sun, 31 Oct 2010 09:35:28 -0400
To: “personal-kdbplus@googlegroups.com”
Mime-Version: 1.0 (iPhone Mail 8B117)
Hi Ben,
DNA is a Citi specific implementation so can’t help with doing it that way, b=
ut keep in mind any constant copying (ie large amounts of data) you do from=
q to q will halt a q process because it’s single threaded. Multi-threading i=
s out of the question. (hence DNA’s raison d’=C3=AAtre)
The only way around locking up both q processes is via replay-able log files=
a la -11! with a count specified.
Tim
I think that needs clarifying further.
kdb+ in single threaded mode sends as much data as the tcp connection can absorb, and then backs off to continue processing other input, resuming any pending sends later.
A receiving q process that issued a sync request and is awaiting a response will block until that response is received in full.
Blocking can be circumvented by using async messaging; however an applications required behavior may not allow such interleaving.
X-Mailer: Apple Mail (2.936)
you can retrieve everything in the root space by getting `.
be aware of the timing considerations charlie and timothy mentioned tho
$ q -p 5050
q)a:1
q)b:`foo
q)c:(x:())
$ q
q). upsert hopen[5050]
.
. q)a 1 q)b
foo
q)c
x
One option would be to write a q plug in module in C and implement the q fork function.
regards,
Junan
Junan, if you’re referring to the fork system call, this will segfault q. If you mean something else, please elaborate.
something like the following, I didn't try, but why will it segfault q?
# **include**** \<k.h\>**
K q_fork(K x)
{
int pid = fork();
**return** ki(pid);
}
qfork:qfork 2:(
q_fork;1)
q)qfork 1
13178
q)0
q)\
q)\
I compiled the code and test it. the fork succeeded with no segfault.?
regards.
Junan