You can use the thread affinity tags. This will allow you to group
threads together. I had to do this since Mac OS X is expensive when
sharing common data across cpu dies.
Note that "thread" affinity is actually cache affinity in this API,
which doesn't sound like what the OP wanted. I get the feeling he
doesn't care what cores are used to run his threads, as long as no
more than two are running simultaneously. If that's the case, I
don't think there's any way to do that other than control your
threads yourself.