[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Difficult Problem
From: |
Crowder, Brian |
Subject: |
Difficult Problem |
Date: |
Wed, 22 Aug 2001 15:56:55 -0700 |
I have a pre-existing C++ architecture in a project that I'd like to add
guile to. The problem is, the program heavily depends upon threads (in both
Win32 and Linux). I need (ideally) to be able to have multiple threads
executing different guile scripts or expressions simultaneously.... I've
taken a stab at this, but I don't seem to be able to get the interpreter in
a useful state at the time a thread is read to execute...
The arch is something like this (pseudocode):
main() { gh_enter(real_main); }
real_main() {
CPPThread threads[10]; //spawns threads
for (int i = 0; i < 10; i++)
threads[i]->Run() // start threads running
wait_for_threads_to_finish();
}
CPPThread::Run()
{
gh_eval_str("(+ 3 4)"); // ERROR: Stack overflow
}
Any suggestions on making this work, or am I on crack?
- Difficult Problem,
Crowder, Brian <=